How to run a maven project/main class in netbeans without building first?

Not found a way to run this in Netbeans, but as a workaround am running the project from the command line using:

mvn exec:java -Dexec.mainClass="com.rory.djgx.server.Main"

Just need to ensure this is executed in the root directory of the compiled classes (.class), e.g. com/rory/djgx and that the pom.xml is in this root directory.


If you want to just run the Build / Compile have an option to use all the powers of the Build Phases, as Validate, Build, Test, Package, Integration, Test, Verify, Install or Deploy. To do this you must:

-Right Click on Project -> Custom -> Goals ...

-In the Goals you can choose the more specifically option choice to build whatever you want, like Compile, Deploy, etc...