是否可以自定义添加清单在NetBeans 6.7.1编译一个Java库? [英] Is it possible to add a custom manifest to a Java library compiled in Netbeans 6.7.1?
问题描述
我尝试添加 manifest.file = $ {}对于src.dir /manifest.mf
来project.properties,而是通过build-impl.xml中我看到了希望在 manifest.available
通常伴随着 main.class
状态,所以这让我相信,我的表现会被添加仅如果包有一个主类,矿山,是一个图书馆,没有。不管我试过了,结果库JAR只包含自动生成的清单只蚂蚁版本和创建-通过。
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.
推荐答案
我最终加入的罐在build.xml的任务,这是因为它让我加的注册任务也清单更新后:
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>
这篇关于是否可以自定义添加清单在NetBeans 6.7.1编译一个Java库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!