A Minimalistic POM For JavaEE 6/7

The essential pom for JavaEE projects is < 40 lines of xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

The war plugin has only has to be added to make web.xml optional :-). If you need a web.xml (for JAX-RS or Servlets web.xml is not needed), you can remove the war plugin as well.

The pom.xml was also checked-in into: https://github.com/AdamBien/javaee-essentials-pom

If you are planning to write tests (:-)), you should replace the javaee-web-api dependency with an actual server implementation.

See you at Java EE Workshops at MUC Airport (Maven is discussed in the "Effective JavaEE" workshop)!

NEW airhacks.com workshops: MicroProfile with Quarkus and Micro Frontends with Web Components at MUC airport

airhacks.fm the podcast:

Stay in touch: airhacks.news.


Hello Adam,

Has the crippled APIs problem you mentioned in a previous article (http://www.adam-bien.com/roller/abien/entry/trouble_with_crippled_java_ee) been resolved?

Posted by Gérald on April 28, 2013 at 02:05 PM CEST #


no. It is going to be resolved in JavaEE 7. For JavaEE 6 you will have to choose an application server. I'm going to add a note to this post.

Thanks for reminding me!,


Posted by Adam Bien on April 28, 2013 at 03:13 PM CEST #

This is for Java EE 6 and will not work for Java EE 7 ?

Posted by Arun Gupta on April 28, 2013 at 07:14 PM CEST #

What would the minimum pom file look like if you need to create an ear file (needed for WebSphere)?

Posted by Craig Doremus on April 29, 2013 at 10:33 PM CEST #


it would work with JavaEE7. However, there is no a Maven JavaEE7 dependency yet deployed to Maven central. You would have to use the dependency from java.net now. I guess it is going to be resolved after JavaEE 7 is finalized.

thanks for the comment,


Posted by Adam Bien on April 30, 2013 at 11:27 PM CEST #


I never used EARs in JavaEE6 projects again. I think the last time I did it in ~2010.

Use NetBeans Maven / Ear wizard or e.g. org.codehaus.mojo.archetypes:ear-javaee6 to get the first idea.

Usually you can delete a lot of stuff afterwards (what I did for WAR projects),



Posted by Adam Bien on April 30, 2013 at 11:30 PM CEST #

To further shorten the POM you could replace the plugin declarations with only the properties:


Posted by Arend v. Reinersdorff on August 08, 2013 at 12:24 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
Online Workshops
...the last 150 posts
...the last 10 comments