gpt4 book ai didi

java - Axis2-maven依赖失败

转载 作者:行者123 更新时间:2023-12-02 12:09:33 29 4
gpt4 key购买 nike

我正在实现连接到 WSO2 的 Web 服务,因此我添加了一些必需的依赖项,即

<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

现在,当我尝试打开该网站时,该网站不可用,因此无法下载 Artifact 。有没有办法将该存储库更改为其他内容,以便我可以从那里下载它。

最佳答案

答案隐藏在父 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)中的设置,并允许成功导入文件。

关于java - Axis2-maven依赖失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46645617/

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