Since the NetBeans integrates to the Maven quite well, It will use the maven configuration (POM) for handling the lifecycle, e.g. clean, build(install) and test. For example, when you right click at the project and select "Clean and Build", you may see the something like the following:
cd D:\temp\prj\netbeans\dummy;
JAVA_HOME=C:\\Java.Application\\Sun\\Java\\jdk1.6.0_31 "\"
C:\\Java.Application\\Sun\\NetBeans 7.1\\java\\maven\\bin\\mvn.bat\""
clean install
I'm using the maven-surefire-plugin for setting/passing the system properties as the following:-
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<encoding>UTF-8</encoding>
<systemProperties>
<property>
<name>DEF</name>
<value>456</value>
</property>
</systemProperties>
<argLine>-DABC=123</argLine>
</configuration>
</plugin>
</plugins>
</build>
You may see that there are 2 positions for passing the system properties as the following:
- The systemProperties tag
- The argLine tag
Regarding to the argLine tag, you can pass, not only the system properties, but also any further JVM arguments, e.g. -Xms, -Xmx as well.
You may see further information about the system properties here and the argLine here.