1

I am trying to deploy project artifact into Archiva remote repository but keeps getting this error:

Error Message:

[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]

I am using Maven 3.0.5, Archiva 1.3.6, Android Development Kit. This is a maven project and I execute via Run As --> Maven build --> (Goals) deploy.

Below are the configurations:

Settings.xml Note:

    <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>

Really appreciate your help. Thank you.

Gzzzy
  • 31
  • 1
  • 6

1 Answers1

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>
Chris Harris
  • 1,329
  • 4
  • 17
  • 28