Axis2-maven依赖失败

时间:2017-10-09 11:42:32

标签: java maven wso2 jax-rs

我正在实现连接到WSO2的webservice,所以我添加了一些必需的依赖项,即

<dependency>
    <groupId>org.wso2.carbon</groupId>
    <artifactId>org.wso2.carbon.user.core</artifactId>
    <version>3.0.0</version>
</dependency>

然而,抛出了maven异常:

org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.axis2:axis2-kernel:jar:SNAPSHOT

Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to transfer org.apache.axis2:axis2-kernel:pom:SNAPSHOT from http://ws.zones.apache.org/repository2 was cached in the local repository, resolution will not be reattempted until the update interval of apache-ws-snapshots2 has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.axis2:axis2-kernel:pom:SNAPSHOT from/to apache-ws-snapshots2 (http://ws.zones.apache.org/repository2): ws.zones.apache.org

Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer org.apache.axis2:axis2-kernel:pom:SNAPSHOT from http://ws.zones.apache.org/repository2 was cached in the local repository, resolution will not be reattempted until the update interval of apache-ws-snapshots2 has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.axis2:axis2-kernel:pom:SNAPSHOT from/to apache-ws-snapshots2 (http://ws.zones.apache.org/repository2): ws.zones.apache.org

现在,当我尝试打开网站时,它不可用,因此无法下载工件。有没有办法将该回购改为其他东西,所以我可以从那里下载。

2 个答案:

答案 0 :(得分:0)

您必须使用以下命令更新SNAPSHOT工件:

-U

示例:

mvn clean install -U

答案 1 :(得分:0)

答案是隐藏在父母POM中。更具体地说:

<groupId>org.apache.axis2</groupId>
<artifactId>axis2-parent</artifactId>
<version>1.6-wso2v1</version>
<packaging>pom</packaging>
<name>Apache Axis2 - Parent</name>

列出了使用过的存储库,特别是

 http://ws.zones.apache.org/repository2
像这样:

<id>apache-ws-snapshots2</id>
<name>Apache ws.zones - 2</name>
<url>http://ws.zones.apache.org/repository2</url>

<id>ws-zones</id>
<name>Apache WS Zones Repository</name>
<url>http://ws.zones.apache.org/repository2</url>

现在,存储库已经死了,所以当我尝试添加依赖项时,它失败了。解决方案是在settings.xml中添加具有相同ID的正确存储库。所以记录看起来像这样:

    <repository>
      <id>ws-zones</id>
      <name>Maven central repository</name>
      <url>http://repo1.maven.org/maven2/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>

此设置将覆盖父POM(或任何POM)中的设置,并允许成功导入文件。