Adam Bien's Weblog

A Minimalistic POM For JavaEE 6/7

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

<project xmlns="" xmlns:xsi=""

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:

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 workshop: HTML 5 and JavaScript Essentials, Three days in April 2017: from Java EE 7 Architectures over Microservices to Performance, Troubleshooting and Monitoring
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.


A book about rethinking Java EE Patterns


Hello Adam,

Has the crippled APIs problem you mentioned in a previous article ( 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 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