I'm working on a Maven project, and after resolving many configuration problems, finally I am able to build the project successfully in Eclipse. After selecting maven install and seeing build success, a .jar artifact is now created in the target folder.

OK. Now as for the execution, instead of manually running the .jar in command line (java -jar myJarFile.jar), how can I automatically run it inside Eclipse?


Use the exec-maven-plugin the run the java launcher with the jar argument during the integration-test phase:


In Eclipse, right click, select Run As and choose Maven Test to run it.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.