Java Maven 中的 Ejb3 依赖

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3641624/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 03:04:17  来源:igfitidea点击:

Ejb3 dependency in Maven

javamaven-2ejb-3.0

提问by Kermit

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

我最近看到 Sun/第三方发布了一个 maven 依赖项,它只包含 EJB3 和 JPA 等接口。

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

有谁知道 groupId、artifactId、repository 等他们在哪里?我宁愿不使用 OpenEJB、Glassfish 等。

回答by Colin Hebert

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 :

由 java.net 存储库提供:

<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 :

资源 :

回答by hohonuuli

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

如果您想要最新的 Java EE 6(EJB 3.1、JPA 2.0 等),那么您可以使用以下依赖项:

<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:

它也在 java.net 存储库中:

<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>

回答by trunikov

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

似乎存储库“maven2-repository.dev.java.net”的布局已更改。目前正确的依赖如下:

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