Search code examples
mavennetbeansinstallationexecutable-jarnetbeans-platform

How to export NetBeans Platform Application using Maven to an executable installer?


Update: I have found the solution and it is posted below. Original question: "How to export NetBeans Platform Application using Maven to an executable JAR?"

I am new to desktop application development and I started learning about the NetBeans platform.

I followed this tutorial on the NetBeans website: NetBeans Platform CRUD Tutorial Using Maven

The question is how do I export the completed project into an executable JAR file? There is actually 3 projects; the -app, -parent, -branding, + any additional modules you have. How do I package everything including the Java DB file into a single JAR file for easy distribution? There are instructions on how to do this using Ant, but no one has asked this question regarding Maven.

Any help is appreciated.

Thanks in advance.


Solution

  • I have found the solution and I am posting it here to help noobs like me in the future.

    1. Right click the -app project>properties

      enter image description here

    2. Under build>installer, select the installers you want

      enter image description here

    3. Under actions, create a new custom action and call it whatever you want. I called it "Generate installers". Enter "nbm:build-installers" under execute goals.

      enter image description here

    4. Right click the project>custom>Generate installers

      enter image description here

    5. When it's done, the installer.exe file will appear under the -app/target folder

      enter image description here