Ejb3 dependency in Maven
Asked Answered
H

3

8

I saw recently that Sun/a third party had released a maven dependency containing only the interfaces for e.g. EJB3 and JPA.

Does anyone know the groupId, artifactId, repository etc where they are? I would prefer to not use the OpenEJB, Glassfish counterparts etc.

Heriberto answered 4/9, 2010 at 9:22 Comment(0)
M
17

If you want the latest Java EE 6 (EJB 3.1, JPA 2.0, etc) Then you can use the following dependency:

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>6.0</version>
    <scope>provided</scope>
</dependency>

and it's also in the java.net repository:

<repository>
    <id>maven2-repository.dev.java.net</id>
    <name>Java.net Repository for Maven</name>
    <url>http://download.java.net/maven/2/</url>
    <layout>default</layout>
</repository>
Mckinley answered 15/9, 2010 at 23:27 Comment(1)
+1 for the support of EJB 3.1 and newer. ejb-api dependency provided with other answers support only up to verson 3.0.Embolectomy
C
6

It seems that layout of the repository "maven2-repository.dev.java.net" has changed. At the moment correct dependency is as below:

<dependency>
  <groupId>javax.ejb</groupId>
  <artifactId>ejb-api</artifactId>
  <version>3.0</version>
  <scope>provided</scope>
</dependency>
Concession answered 11/1, 2011 at 9:54 Comment(1)
I just followed this and worked for me. The only think I changed was the scope from "test" to "provided". Don't know how but it worked for me.Triacid
P
2

There is those dependecies :

<dependency>
    <groupId>javax.ejb</groupId>
    <artifactId>ejb</artifactId>
    <version>3.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>javax.persistence</groupId>
    <artifactId>persistence-api</artifactId>
    <version>1.0</version>
    <scope>provided</scope>
</dependency>

provided by java.net repository :

<repositories>
    <repository>
        <id>maven2-repository.dev.java.net</id>
        <name>Java.net Repository for Maven</name>
        <url>http://download.java.net/maven/2/</url>
        <layout>default</layout>
    </repository>
</repositories>

Resources :

Pinky answered 4/9, 2010 at 9:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.