Is there a Maven “phase” or “goal” to simply execute the main method of a Java class? I have a project that I’d like to test manually by simply doing something like “mvn run”.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See the exec maven plugin. You can run Java classes using:
The invocation can be as simple as
mvn exec:javaif the plugin configuration is in your pom.xml. The plugin site on Mojohaus has a more detailed example.