maven 无法传输工件,未授权,ReasonPhrase:未授权

新手上路,请多包涵

我在 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 许可协议

阅读 570
1 个回答

当我的代理服务器没有为 Maven 正确配置时,我遇到了这个问题。您应该向网络管理员咨询有关代理服务器的信息,并将其添加到 conf 目录下的 settings.xml 中。

您可以查找 <proxies> 标记并更新字段。

当我遇到这个问题时,我也觉得它只发生在几个 jar 中,但是所有其他必需的 jar 文件已经存在于我的本地存储库中,因此我只为几个 jar 获取它。

原文由 Ujjwal 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题