我正在使用JBoss EAP 6.1和Java EE 6。
JBoss工具在eclipse上添加了JBoss运行时库,比如org.jboss.resteasy.annotations.cache.NoCache
,但它无法在maven上编译,因为maven一无所知。
我想通过maven添加所有JBoss EAP库,以便成功构建它。是否记录了我必须使用的工件才能在类路径中添加所有JBoss EAP库?我可以添加一个表示整个Java EE 6堆栈的依赖项及其org.jboss.resteasy.annotations.cache.NoCache
之类的JBoss扩展吗?
我正在寻找类似的东西:
<dependency>
<groupId>org.jboss.eap</groupId>
<artifactId>jboss-eap</artifactId>
<version>6.1</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
然后,当我们更新容器和繁荣时,我们只需更改<version>6.2</version>
,魔术!
答案 0 :(得分:2)
此信息位于JBoss捆绑的快速入门中包含的pom.xml文件中。
来自厨房的例子:
<dependencies>
<!-- JBoss distributes a complete set of Java EE 6 APIs including a Bill
of Materials (BOM). A BOM specifies the versions of a "stack" (or a collection)
of artifacts. We use this here so that we always get the correct versions
of artifacts. Here we use the jboss-javaee-6.0-with-tools stack (you can
read this as the JBoss stack of the Java EE 6 APIs, with some extras tools
for your project, such as Arquillian for testing) and the jboss-javaee-6.0-with-hibernate
stack you can read this as the JBoss stack of the Java EE 6 APIs, with extras
from the Hibernate family of projects) -->
<dependency>
<groupId>org.jboss.bom.eap</groupId>
<artifactId>jboss-javaee-6.0-with-tools</artifactId>
<version>${version.jboss.bom.eap}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.bom.eap</groupId>
<artifactId>jboss-javaee-6.0-with-hibernate</artifactId>
<version>${version.jboss.bom.eap}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
{0}在父pom中定义
${version.jboss.bom.eap}
这里解释https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/html/Development_Guide/Maven_BOM_Usage.html(需要redhat支持帐户)
这里还列出了JBoss组件版本https://access.redhat.com/articles/112673