This short tutorial describes how to customize the app.conf file of a NetBeans Platform based application in the maven build environment.
Every application developed on top of the NetBeans Platform has a file called app.conf You will find this file in the generated target folder: app/etc
This file describes some startup and runtime parameter of your NetBeans Platform based application. Here is a simple example how the generated standard app.conf file could look like:
# ${HOME} will be replaced by user home directory according to platform src/main default_userdir="${HOME}/.${APPNAME}" default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}" # options used by the launcher by default, can be overridden by explicit # command line switches default_options="--branding platonframework -J-Xms24m -J-Xmx256m" # for development purposes you may wish to append: -J-Dnetbeans.logger.console=true -J-ea # default location of JDK/JRE #jdkhome="/path/to/jdk" # clusters' paths separated by path.separator (semicolon on Windows, colon on Unices) #extra_clusters=By edditing this file you could for example specify a new jdkhome or start the application with more ore less memory. But when you build your application next time all changes will get lost because the NetBeans Platform build system will update this file too and override it with the default values...
But how to customize this file and tell the build-system not to use the defaults?
The easiest way to customize the file is to copy the current content to a new file called e.g. customized.conf - within this file you can change everything you want to. Then you have to tell the nbm-maven-plugin to use your customized.conf file. Just declare the following in the pom of your app-Module inside the build section:
The nbm-maven-plugin will use your file as copy template when building the application. At the end it will still be called app.conf - but with your custom code inside ;-) Very easy but sometimes hard to google that out...org.codehaus.mojo nbm-maven-plugin true PATH/TO/customized.conf