views:

377

answers:

1

I tried adding manifest.file=${src.dir}/manifest.mf to project.properties, but looking through the build-impl.xml I see that the manifest.available is usually accompanied by main.class condition, so it makes me believe that my manifest would be added only if the package has a main class, which mine, being a library, does not have. No matter what I tried, the resulting library jar contains just the auto-generated manifest with only Ant-Version and Created-By.

A: 

I ended up adding a Jar task in the build.xml, which was really good since it allowed me to add a Sign task also after the manifest update:

<target name="-post-jar">
    <jar destfile="${dist.jar}"
        update="true">
       <manifest>
         <attribute name="Built-By" value="..."/>
         <attribute name="Specification-Title" value="..."/>
         <attribute name="Specification-Vendor" value="..."/>
         <attribute name="Specification-Version" value="..."/>
         <attribute name="Implementation-Vendor" value="..."/>
         <attribute name="Implementation-Title" value="..."/>
         <attribute name="Implementation-Version" value="..."/>
       </manifest>
    </jar>
    <signjar jar="${dist.jar}"
        alias="..."
        keystore="..."
        storepass="..."/>
</target>
Remus Rusanu