User Tools

Site Tools


How to self-sign your Netbeans Modules Automatically

This is a necessary step to providing your modules to the public via the Netbeans Plugin Portal. This assumes you have more than one module and that your modules are grouped into a suite. I suppose if you had one module you could create a 1-module suite and these instructions would also work in this case.


  1. Get a copy of the ant-contrib library. I downloaded “ant-contrib-1.0b3.jar” (
  2. Place the “ant-contrib-1.0b3.jar” file in your module suite
  3. Insert the “suite.-init” and “update-keystore-info” targets into the build.xml file of your suite as detailed below.
  4. Modify the <pathelement location=“ROSProjectType/release/modules/ext/ant-contrib-1.0b3.jar”/> line to point to the relative path (from the suite folder) to your “ant-contrib-1.0b3.jar” file.
  5. Edit your nbproject/ file as detailed below.
  6. Edit your nbproject/private/ file as detailed below.
  7. Try the “Packages as→NMBs” option from your module suite drop down.

Hope it works for you!

Insert into the bottom of your build.xml file of your module suite (before the closing project tag)
    <taskdef resource="net/sf/antcontrib/antlib.xml">
            <pathelement location="ROSProjectType/release/modules/ext/ant-contrib-1.0b3.jar"/>

    <target name="-init" depends="suite.-init">
        <!--Create/Update keystore-->
        <delete file="${keystore.location}${}"/>
        <mkdir dir="${keystore.location}"/>
        <!-- <echo message="${keystore.location}"/> -->
        <genkey alias="${keystore.alias}" storepass="${keystore.password}"
                verbose="true" validity="365"/>
        <!--Update keystore info in projects-->
        <antcall target="update-keystore-info"/>

    <target name="update-keystore-info">
        <!-- <echo message="${modules}, ${keystore.location}, ${}, ${keystore.password}"/> -->
        <for list="${modules}" delimiter=":" param="cur" trim="true">
                <!-- <echo message="${cur}"/> -->
                <mkdir dir="@{cur}/nbproject/"/>
                <!--Place the information in the properties file-->
                <propertyfile file="@{cur}/nbproject/">
                    <entry  key="keystore" value="../${keystore.location}${}"/>
                    <entry  key="nbm_alias" value="${keystore.alias}"/>
                <mkdir dir="@{cur}/nbproject/private/"/>
                <!--Place the password in the private properties file-->
                <propertyfile file="@{cur}/nbproject/private/">
                    <entry  key="storepass" value="${keystore.password}"/>

The fields you need to add to your file (in the nbfolder in your suite's home directory) are as follows:

Add these lines to your nbproject/ file
keystore.dname=CN=<your Name>, OU=<your Organization Unit>, O=<your Organization>, C=<your Country>
keystore.alias=<your alias>

For those in the United States set <your Country> to US.

You also need to add a storepassword entry to your private project properties. To do so edit the “nbproject/private/” file. Add the following entry:

Add this line to your nbproject/private/ file

Note the keystore.password in “nbproject/” storepass in “nbproject/private/” need to match.

how_to_sign_your_netbeans_modules_automatically.txt · Last modified: 2015/09/24 20:05 by arwillis