我在 pom.xml
文件中添加了以下依赖项:
<dependency>
<groupId>org.tuckey</groupId>
<artifactId>urlrewritefilter</artifactId>
<version>4.0.4</version>
</dependency>
我有很多 Maven 依赖项,但是当我添加上面的依赖项时,我得到:
Failed to read artifact descriptor for org.tuckey:urlrewritefilter:jar:4.0.4: Could not transfer artifact org.tuckey:urlrewritefilter:pom:4.0.4 from/to central (http://app1.stage.server.net/artifactory/libs-release): Not authorized, ReasonPhrase:Unauthorized. -> [Help 1]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
这是 settings.xml
文件的样子:
..
<servers>
<server>
<username>user</username>
<id>central</id>
<password>my-password</password>
</server>
<server>
<username>user</username>
<id>snapshots</id>
<password>my-password</password>
</server>
</servers>
<profiles>
...
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
..
有帮助吗?谢谢。
原文由 tokhi 发布,翻译遵循 CC BY-SA 4.0 许可协议
当我的代理服务器没有为 Maven 正确配置时,我遇到了这个问题。您应该向网络管理员咨询有关代理服务器的信息,并将其添加到 conf 目录下的
settings.xml
中。您可以查找
<proxies>
标记并更新字段。当我遇到这个问题时,我也觉得它只发生在几个 jar 中,但是所有其他必需的 jar 文件已经存在于我的本地存储库中,因此我只为几个 jar 获取它。