Create both war and jar files using maven

This tutorial will show you how to create both war and jar file in an web application using maven.

Sometimes we need to create both war and jar files from an web application using maven because some other standalone project needs to include the jar file of the web application.



Apache Maven

We need maven war plugin to create an war file from the web application

We need maven jar plugin to create a jar file from the web application

We need to keep the generated jar file into the build directory. So use the below maven plugin.

Putting all together, the entire pom.xml file is given below

That’s all. Thanks for reading.


Software Professional, I am passionate to work on web/enterprise application. For more information please go to about me. You can follow on Twitter. You can be a friend on Facebook or Google Plus or Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.