/** * Add an attribute to the manifest - it is added to the main section. * * @param attribute the attribute to be added. * * @exception ManifestException if the attribute is not valid. */ public void addConfiguredAttribute(Manifest.Attribute attribute) throws ManifestException { checkAttribute(attribute); nestedManifest.addConfiguredAttribute(attribute); }
private Manifest createManifest() throws ManifestException { Manifest manifest = new Manifest(); manifest.addConfiguredAttribute(new Manifest.Attribute("Main-Class", MAIN_CLASS)); for (Map.Entry<String, String> entry : manifestEntries.entrySet()) manifest.addConfiguredAttribute(new Manifest.Attribute(entry.getKey(), entry.getValue())); return manifest; }
private Manifest createManifest() throws ManifestException { Manifest manifest = new Manifest(); manifest.addConfiguredAttribute(new Manifest.Attribute("Main-Class", MAIN_CLASS)); for (Map.Entry<String, String> entry : manifestEntries.entrySet()) manifest.addConfiguredAttribute(new Manifest.Attribute(entry.getKey(), entry.getValue())); return manifest; }
mf.addConfiguredAttribute( new Manifest.Attribute(Attributes.Name.MANIFEST_VERSION.toString(), "1.0")); mf.addConfiguredAttribute( new Manifest.Attribute("Created-By", "Jade Maven Plugin Multijar")); mf.addConfiguredAttribute( new Manifest.Attribute(key, manifestEntries.get(key)));
/** * @param xmaDigest * @author s1462 */ private void updateJar(String xmaDigest) { try { //writing checksum direct in the manifest file Manifest manifest = new Manifest(); manifest.addConfiguredAttribute(new Manifest.Attribute("XMA-Digest", xmaDigest)); Jar jarTask = new Jar(); jarTask.init(); jarTask.setProject(this.getProject()); jarTask.setOwningTarget(this.getOwningTarget()); jarTask.setTaskName("XMAChecksum"); jarTask.setTaskType("Jar"); jarTask.setUpdate(true); jarTask.setDestFile(file); jarTask.addConfiguredManifest(manifest); jarTask.execute(); } catch (Exception e1) { if(verbose) { e1.printStackTrace(); } throw new BuildException(e1); } }