Sign a JAR automatically when building from Netbeans

bguiz picture bguiz · Mar 25, 2010 · Viewed 6.9k times · Source

I want to know if Netbeans has some option or setting that will allow me to automatically sign a jar as part of the build.

Answer

trashgod picture trashgod · Mar 26, 2010

In your -post-jar ant target, it may be convenient to read the <signjar> password from a file, e.g. ~/.keyconf. Give the file user-only access: e.g. 400 or 600.

<loadfile srcfile="${user.home}/.keyconf" property="keyconf"/>
<signjar alias="..." storepass="${keyconf}">
    ...
</signjar>