【问题标题】:How to configure maven pom repositories?如何配置 maven pom 存储库?
【发布时间】:2016-02-26 20:44:53
【问题描述】:

我按照如下所述创建项目:

TEIID/Archetype+Template+Connector+Project

在 mvn clean install 我得到:

[ERROR] Failed to execute goal on project connector-myType: 
Could not resolve dependencies for project org.jboss.teiid.connectors:connector-myType:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.jboss.teiid:teiid-api:jar:8.7.0.Final: 
Failed to read artifact descriptor for org.jboss.teiid:teiid-api:jar:8.7.0.Final: 
Failure to find org.jboss.integration-platform:jboss-integration-platform-bom:pom:6.0.0-SNAPSHOT
in http://snapshots.jboss.org/maven2 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]

找不到 org.jboss.integration-platform:jboss-integration-platform-b​​om:pom:6.0.0-SNAPSHOT 在http://snapshots.jboss.org/maven2 中被缓存在本地仓库中,

我添加到我的 pom.xml 中:

<repositories>

<repository>
    <id>jboss</id>
    <name>jboss</name>
    <url>http://snapshots.jboss.org/maven2</url>
    I also tried with https://repository.jboss.org/nexus/content/repositories/snapshots/
</repository>
</repositories>    

但它没有帮助,虽然两者都

http://snapshots.jboss.org/maven2/org/jboss/integration-platform/jboss-integration-platform-bom/6.0.0-SNAPSHOT/

http://snapshots.jboss.org/maven2/org/jboss/integration-platform/jboss-integration-platform-bom/6.0.0-SNAPSHOT/ 存在!

有什么问题吗?

【问题讨论】:

  • 你试过 mvn -U clean install。为了强制更新。或者您可以删除 .m2 目录并重试相同的命令。

标签: java maven jboss7.x maven-3 wildfly


【解决方案1】:

存储库未正确设置。看看Maven Getting Started Guide

基本上应该是:

<repositories>
    <repository>
        <id>jboss</id>
        <name>jboss</name>
        <url>http://repository.jboss.org/nexus/content/groups/public/</url>
        <layout>default</layout>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>   

【讨论】:

  • 看来连default也是必不可少的。其实我之前尝试过类似的东西,但是没有,它没有用。有趣的是,maven 并没有抱怨任何配置,但它使用它却抱怨找不到 pom。谢谢帮助。
猜你喜欢
  • 2013-12-28
  • 2012-09-16
  • 1970-01-01
  • 2012-02-03
  • 2023-03-10
  • 1970-01-01
  • 2016-03-25
  • 1970-01-01
  • 2014-03-05
相关资源
最近更新 更多