1

我正在尝试将项目工件部署到 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.5Archiva 1.3.6Android 开发工具包。这是一个 Maven 项目,我通过Run As --> Maven build --> (Goals) deploy执行。

以下是配置:

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>

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

4

1 回答 1

0

A few suggestions:

1.) Ensure that you have all your servers listed in your Maven settings.xml. This gets me sometimes.

2.) Ensure that your snapshot repo id matches the repo id defined within Archiva.

3.) Ensure that you have access to the snapshots repo, even as admin. Permissions can be revoked.

4.) Ensure that you have the right password.

5.) I've had a restart of Archiva fix this problem before.

6.) And, finally, ensure that you have the following settings.xml config in place. This solution doesn't quite fit your scenario, but it's good to list nonetheless. The following config will allow you to deploy snapshots to a custom snapshots repo that's part of a repository group (i.e. - a snapshots repo for a particular team):

<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>
于 2015-03-20T19:36:31.833 回答