I'm running ant 1.8.0 in verbose mode. I have created a manifest containing Implementation-Title, -Version and -Vendor and the resulting JAR contains a manifest with those in it. The JAR's class runs fine. However, output from ant says
[jar] No Implementation-Title set.No Implementation-Version set.No Implementation-Vendor set.
Is this just a bug in ant or am I missing something here?
Thanks
Here's my ant code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="helloworld.makejar" default="makejar" basedir=".">
<target name ="makejar" description="Create a JAR for the HelloWorld project">
<delete file="helloworld.jar" />
<delete file="MANIFEST.MF" />
<manifest file="MANIFEST.MF">
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="project.builder.example.HelloWorld" />
<section name="common">
<attribute name="Specification-Title" value="Example" />
<attribute name="Specification-Version" value="1.0.0" />
<attribute name="Specification-Vendor" value="Example Organization" />
<attribute name="Implementation-Title" value="common" />
<attribute name="Implementation-Version" value="1.0.0 today" />
<attribute name="Implementation-Vendor" value="Acme Corp." />
</section>
</manifest>
<jar jarfile="helloworld.jar"
includes="**/*.class"
basedir="bin"
manifest="MANIFEST.MF"
/>
</target>
<javac srcdir="src" destdir="bin" />
</project>
I think the problem is that the attributes must be defined as children of the manifest element, as opposed to being children of the nested section.
Update
Maybe using an inline manifest element would make a difference. The following snippet is from the Ant docs:
<jar destfile="test.jar" basedir=".">
<include name="build"/>
<manifest>
<!-- Who is building this jar? -->
<attribute name="Built-By" value="${user.name}"/>
<!-- Information about the program itself -->
<attribute name="Implementation-Vendor" value="ACME inc."/>
<attribute name="Implementation-Title" value="GreatProduct"/>
<attribute name="Implementation-Version" value="1.0.0beta2"/>
<!-- details -->
<section name="common/MyClass.class">
<attribute name="Sealed" value="false"/>
</section>
</manifest>
</jar>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With