How to run a Maven jar project from eclipse without tomcat

If you just created a Maven project of package type jar and wondering how to run the jar from Maven command without deploying it to Tomcat or executing the jar using run time then you simply add the below plugin code that is highlighted in your under your pom.xml build -> plugins tag,

<project xmlns=""








Note: the mainClass tag should contain the package to your main class.

Now to run the code in eclipse, all you need to do is under your maven configuration under goal ass exec:java (or clean build exec:java)

Run Maven Project using Eclipse Run Configuration
Run Maven Project using Eclipse Run Configuration
[INFO] Scanning for projects...
[INFO] ------------------------< code2care:csvexample >------------------------
[INFO] Building csvexample 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ csvexample ---
Hello World!
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.624 s
[INFO] Finished at: 2020-11-06T22:37:38+05:30
[INFO] ------------------------------------------------------------------------

Recent Posts:

Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.