gpt4 book ai didi

maven - 无法在我的 Maven 项目中使用依赖项 jboss-javaee-6.0

转载 作者:行者123 更新时间:2023-12-01 08:32:41 24 4
gpt4 key购买 nike

我已经使用 JBoss 7.1.1 建立了一个 maven 项目,我想使用 JavaEE 库。在我设置的根 pom.xml 中:

<repositories>
<repository>
<id>jboss</id>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>

我在根 pom.xml 和 ejb maven 模块的 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>

当我执行 maven clean install 时,我收到此错误:

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]

我的配置怎么了?

编辑 1
如果我从根 pom.xml 中删除 jboss 存储库,我会收到此错误:

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

最佳答案

这是由 bug 引起的在 Xalan POM 文件中。以下workaround为我解决了这个问题:

<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 - 无法在我的 Maven 项目中使用依赖项 jboss-javaee-6.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16300544/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com