问题描述
我已经使用JBoss 7.1.1设置了一个maven项目,我想使用JavaEE库。在root pom.xml中,我设置了:
< repositories>
< repository>
< id> jboss< / id>
< url> https://repository.jboss.org/nexus/content/groups/public/< / url>
< / repository>
< / repositories>
我在root pom.xml和ejb maven模块的pom.xml中有这个:
<依赖关系>
< groupId> org.jboss.spec< / groupId>
< artifactId> jboss-javaee-6.0< / artifactId>
< version> 3.0.2.Final< / version>
< scope>已提供< / scope>
< type> pom< / type>
< / dependency>
当我做一个 maven clean install
获取此错误:
无法在项目中执行目标myproject-ejb:无法解析项目myproject的依赖项:myproject-ejb: ejb:1.0-SNAPSHOT:没有找到org.jboss.spec:jboss-javaee-6.0:jar:3.0.2.Final在https://repository.jboss.org/nexus/content/groups/public/被缓存在本地存储库,解决方案将不会被重新尝试,直到jboss的更新间隔过去或更新被强制 - > [帮助1]
我的配置有什么?
编辑1
如果我从根pom.xml中删除jboss仓库,我会收到以下错误:
[ERROR]无法在项目myproject-ejb上执行目标:无法解析项目myproject的依赖项:myproject-ejb:ejb:1.0-SNAPSHOT:以下工件无法解决:org.jboss.spec:jboss-javaee-6.0:jar:3.0.2.Final,xalan:xalan:jar:2.7.1.jbossorg-2:找不到工件org.jboss.spec:jboss-javaee -6.0:jar:3.0.2.Final在中央(http://repo.maven.apache.org/maven2) - > [帮助1]
在Xalan POM文件中的href =https://issues.jboss.org/browse/JBBUILD-708 =noreferrer>错误。以下解决了我的问题: p>
< dependencyManagement>
<依赖关系>
<依赖关系>
< groupId> org.jboss.spec< / groupId>
< artifactId> jboss-javaee-6.0< / artifactId>
< version> 3.0.2.Final< / version>
< type> pom< / type>
< scope>已提供< / scope>
< / dependency>
<! - jboss-javaee-6.0要求:3.0.2.Final(https://issues.jboss.org/browse/JBBUILD-708) - >
<依赖关系>
< groupId> xalan< / groupId>
< artifactId> xalan< / artifactId>
< version> 2.7.1< / version>
< scope>已提供< / scope>
< / dependency>
< / dependencies>
< / dependencyManagement>
I have set up a maven project with JBoss 7.1.1 and I want to use JavaEE libraries.In the root pom.xml I have set:
<repositories>
<repository>
<id>jboss</id>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
I have this in the root pom.xml and and in the ejb maven module´s pom.xml:
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>3.0.2.Final</version>
<scope>provided</scope>
<type>pom</type>
</dependency>
When I do a maven clean install
I get this error:
Failed to execute goal on project myproject-ejb: Could not resolve dependencies for project myproject:myproject-ejb:ejb:1.0-SNAPSHOT: Failure to find org.jboss.spec:jboss-javaee-6.0:jar:3.0.2.Final in https://repository.jboss.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss has elapsed or updates are forced -> [Help 1]
What´s up with my configuration?
EDIT 1
If I remove the jboss repository from the root pom.xml I get this error:
[ERROR] Failed to execute goal on project myproject-ejb: Could not resolve dependencies for project myproject:myproject-ejb:ejb:1.0-SNAPSHOT: The following artifacts could not be resolved: org.jboss.spec:jboss-javaee-6.0:jar:3.0.2.Final, xalan:xalan:jar:2.7.1.jbossorg-2: Could not find artifact org.jboss.spec:jboss-javaee-6.0:jar:3.0.2.Final in central (http://repo.maven.apache.org/maven2) -> [Help 1]
This is caused by a bug in Xalan POM file. The following workaround fixed the problem for me:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>3.0.2.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<!-- Required by jboss-javaee-6.0:3.0.2.Final (https://issues.jboss.org/browse/JBBUILD-708) -->
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
这篇关于不能在我的Maven项目中使用依赖关系jboss-javaee-6.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!