Netbeans prints the command it invokes as the very first line of output.
I use Netbeans 8.2 and how it looks when I click the big green Run button in the maven project:

The first line is read (formatted for better readability):
cd D:\test; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_112" "M2_HOME=C:\\Program Files\\apache-maven-3.3.3" cmd /c "\"\"C:\\Program Files\\apache-maven-3.3.3\\bin\\mvn.cmd\" -Dexec.args=\"-classpath %classpath com.test.AppStarter\" -Dexec.executable=\"C:\\Program Files\\Java\\jdk1.8.0_112\\bin\\java.exe\" -Dexec.workingdir=D:\\test\\target\\dist -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.2\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\""
From this line, I can say that Netbeans :
- goes to the project directory
- sets environment variables (
JAVA_HOME and M2_HOME ) - then execute
cmd , which executes mvn (along its full path)- with a bunch of
-D arguments (which define the working directory and AppStarter as an executable class) - and
exec-maven- plugin with the purpose of exec .
Oleg Kurbatov
source share