将工件部署到Archiva远程仓库时访问被拒绝错误

时间:2013-11-05 01:49:15

标签: maven-3 archiva

我正在尝试将项目工件部署到Archiva远程存储库,但不断收到此错误:

错误消息:

[INFO] --- maven-deploy-plugin:2.8.1:deploy (default-deploy) @ mavenandroidapplication ---
Downloading: http://192.168.10.29:8080/archiva/repository/snapshots/com/stm/idg/android/mavenandroidapplication/1.0-SNAPSHOT/maven-metadata.xml
Uploading: http://192.168.10.29:8080/archiva/repository/snapshots/com/stm/idg/android/mavenandroidapplication/1.0-SNAPSHOT/mavenandroidapplication-1.0-20131105.013101-1.apk
Uploading: http://192.168.10.29:8080/archiva/repository/snapshots/com/stm/idg/android/mavenandroidapplication/1.0-SNAPSHOT/mavenandroidapplication-1.0-20131105.013101-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.707s
[INFO] Finished at: Tue Nov 05 09:31:01 SGT 2013
[INFO] Final Memory: 16M/39M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy (default-deploy) on project mavenandroidapplication: Failed to deploy artifacts: Could not transfer artifact com.stm.idg.android:mavenandroidapplication:apk:1.0-20131105.013101-1 from/to archiva.snapshots (http://192.168.10.29:8080/archiva/repository/snapshots/): Access denied to http://192.168.10.29:8080/archiva/repository/snapshots/com/stm/idg/android/mavenandroidapplication/1.0-SNAPSHOT/mavenandroidapplication-1.0-20131105.013101-1.apk. Error code 401, Unauthorized -> [Help 1]

我正在使用 Maven 3.0.5 Archiva 1.3.6 Android开发工具包。这是一个maven项目,我通过 Run As - >执行。 Maven构建 - > (目标)部署

以下是配置:

将Settings.xml 注意:

    <server>
      <id>archiva.internal</id>
      <username>admin</username>
      <password>123</password>
    </server>
    <server>
      <id>archiva.snapshots</id>
      <username>admin</username>
      <password>123</password>
    </server>

的pom.xml

    <distributionManagement>
        <repository>
            <id>archiva.internal</id>
            <name>Internal Release Repository</name>
            <url>http://192.168.10.29:8080/archiva/repository/internal/</url>
        </repository>
        <snapshotRepository>
            <id>archiva.snapshots</id>
            <name>Internal Snapshot Repository</name>
            <url>http://192.168.10.29:8080/archiva/repository/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

非常感谢您的帮助。谢谢。

1 个答案:

答案 0 :(得分:0)

一些建议:

1.确保您的Maven settings.xml中列出了所有服务器。这有时让我感到高兴。

2.确保您的快照repo id与Archiva中定义的repo id匹配。

3.确保您可以访问快照存储库,即使是管理员也是如此。权限可以撤销。

4.确保您拥有正确的密码。

5.)我之前重新启动了Archiva修复此问题。

6。)最后,确保您具有以下settings.xml配置。这个解决方案并不适合你的场景,但是列出它仍然很好。以下配置允许您将快照部署到存储库组的自定义快照存储库(即 - 特定团队的快照存储库):

<mirror>
    <id><repo_group_id></id>
    <mirrorOf>*, !<team_snapshot_repo_id></mirrorOf>
    <name>My Team's Maven Repository</name>
    <url>http://<HOST>:<PORT>/archiva/repository/<repo_group_id>/</url>
</mirror>