Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Java EE 7 Maven Repository Coordinates

DZone's Guide to

Java EE 7 Maven Repository Coordinates

· Java Zone
Free Resource

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

For those of us doing Java EE development with Maven (which by my own account as a former consultant is pretty much all Java EE/GlassFish adopters), getting our hands on the repository location for Java EE APIs is critically important. Fortunately, Java EE APIs have long been available via Maven central, Java EE 7 is no exception. The Java EE 7 Maven Coordinates on the GlassFish wiki is an extremely handy reference for navigating the Maven Central maze.

It also helps to know that there is a relatively well established set of guidelines for naming Java EE API Maven artifacts. Generally speaking, Java EE Maven artifacts follow this pattern:

<dependency>
    <groupId>[Java EE API package name]</groupId> 
    <artifactId>[Java EE API package name]-api</artifactId>
    <version>[Java EE API version]</version>        
</dependency> 

For the most part though, this is the only Maven coordinate you should need for Java EE 7 applications:

<dependency>
    <groupId>javax</groupId> 
    <artifactId>javaee-api</artifactId>
    <version>7.0</version>        
</dependency>

If you are using just the Web Profile, you should use this instead:

<dependency>
    <groupId>javax</groupId> 
    <artifactId>javaee-web-api</artifactId>
    <version>7.0</version>        
</dependency>

That being said, for those of you that need/want them, the GlassFish wiki outlines where you can find the Maven artifacts for just Java EE concurrency, JPA 2.1, JAX-RS 2, Servlet 3.1, EL 3.0, JMS 2, JSF 2.2, EJB 3.2, JBatch, JSON-P, WebSocket and others.

It should be pretty straightforward to use - give me a shout if you need help setting up Maven.

Bitbucket is the Git solution for professional teams who code with a purpose, not just as a hobby. Get started today, it's free.

Topics:

Published at DZone with permission of Reza Rahman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}