run main class of Maven project [duplicate]

Try the maven-exec-plugin. From there: mvn exec:java -Dexec.mainClass=”com.example.Main” This will run your class in the JVM. You can use -Dexec.args=”arg0 arg1″ to pass arguments. If you’re on Windows, apply quotes for exec.mainClass and exec.args: mvn exec:java -D”exec.mainClass”=”com.example.Main” If you’re doing this regularly, you can add the parameters into the pom.xml as well: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> … Read more