}
private void writeJar(File file, Class<?>[] compiledClasses,
List<MatchedResource> classpathEntries, List<URL> dependencies)
throws FileNotFoundException, IOException, URISyntaxException {
JarWriter writer = new JarWriter(file);
try {
addManifest(writer, compiledClasses);
addCliClasses(writer);
for (Class<?> compiledClass : compiledClasses) {
addClass(writer, compiledClass);
}
addClasspathEntries(writer, classpathEntries);
addDependencies(writer, dependencies);
writer.writeLoaderClasses();
}
finally {
writer.close();
}
}