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

tok*_*khi 9 java maven

我在pom.xml文件中添加了以下依赖项:

<dependency>
  <groupId>org.tuckey</groupId>
  <artifactId>urlrewritefilter</artifactId>
  <version>4.0.4</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

我有很多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
Run Code Online (Sandbox Code Playgroud)

这是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>
..
Run Code Online (Sandbox Code Playgroud)

任何帮助?TNX.

Ujj*_*wal 5

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

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

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