}
}
private static File createDefaultManifest(MavenProject project)
throws ManifestException, IOException, ArchiverException {
Manifest manifest = new Manifest();
Manifest.Attribute attr = new Manifest.Attribute("Created-By", "Apache Maven");
manifest.addConfiguredAttribute(attr);
attr = new Manifest.Attribute("Implementation-Title", project.getName());
manifest.addConfiguredAttribute(attr);
attr = new Manifest.Attribute("Implementation-Version", project.getVersion());
manifest.addConfiguredAttribute(attr);
attr = new Manifest.Attribute("Implementation-Vendor-Id", project.getGroupId());
manifest.addConfiguredAttribute(attr);
if (project.getOrganization() != null) {
String vendor = project.getOrganization().getName();
attr = new Manifest.Attribute("Implementation-Vendor", vendor);
manifest.addConfiguredAttribute(attr);
}
attr = new Manifest.Attribute("Built-By", System.getProperty("user.name"));
manifest.addConfiguredAttribute(attr);
attr = new Manifest.Attribute("Class-Path", jangarooDependencies(project));
manifest.addConfiguredAttribute(attr);
File mf = File.createTempFile("maven", ".mf");
mf.deleteOnExit();
PrintWriter writer = null;
try {
writer = new PrintWriter(new FileWriter(mf));
manifest.write(writer);
} finally {
if (writer != null) {
writer.close();
}
}