Hi All,
I am trying to deploy to Nexus repository, but I am getting following error. Would someone help me?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy (default-deploy) on project my-test: Failed to deploy artifacts: Could no
t transfer artifact org.bhavesh:my-test:jar:1.0-20140326.192116-1 from/to deploy
ment (
http://localhost:8081/nexus/content/repositories/snapshots/): Failed to tr
ansfer file:
http://localhost:8081/nexus/content/repositories/snapshots/org/bhav
esh/my-test/1.0-SNAPSHOT/my-test-1.0-20140326.192116-1.jar. Return code is: 401,
ReasonPhrase: Unauthorized. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run
Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
-----------------------------------------------------------------------
Ran with -X switch
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for
http://localhost:8081/nexus/content/repositories/snapshots/
Downloading:
http://localhost:8081/nexus/content/repositories/snapshots/org/bhavesh/my-test/1.0-SNAPSHOT/maven-metadata.xml
[DEBUG] Could not find metadata org.bhavesh:my-test:1.0-SNAPSHOT/maven-metadata.xml in deployment1 (
http://localhost:8081/nexus/content/repositories/snapshots/)
[DEBUG] Writing tracking file C:\Users\Bob\.m2\repository\org\bhavesh\my-test\1.0-SNAPSHOT\resolver-status.properties
Uploading:
http://localhost:8081/nexus/content/repositories/snapshots/org/bhavesh/my-test/1.0-SNAPSHOT/my-test-1.0-20140328.195302-1.jar
2/3 KB
3/3 KB
Uploading:
http://localhost:8081/nexus/content/repositories/snapshots/org/bhavesh/my-test/1.0-SNAPSHOT/my-test-1.0-20140328.195302-1.pom
2/2 KB
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.434 s
[INFO] Finished at: 2014-03-28T14:53:02-06:00
[INFO] Final Memory: 7M/18M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project my-test: Failed to deploy artifacts: Could not transfer artifact org.bhavesh:my-test:jar:1.0-20140328.195302-1 from/to deployment1 (
http://localhost:8081/nexus/content/repositories/snapshots/): Failed to transfer file:
http://localhost:8081/nexus/content/repositories/snapshots/org/bhavesh/my-test/1.0-SNAPSHOT/my-test-1.0-20140328.195302-1.jar. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project my-test: Failed to deploy artifacts: Could not transfer artifact org.bhavesh:my-test:jar:1.0-20140328.195302-1 from/to deployment1 (
http://localhost:8081/nexus/content/repositories/snapshots/): Failed to transfer file:
http://localhost:8081/nexus/content/repositories/snapshots/org/bhavesh/my-test/1.0-SNAPSHOT/my-test-1.0-20140328.195302-1.jar. Return code is: 401, ReasonPhrase: Unauthorized.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
----------------------------------------------------------------------------------------------------------
Here is POM.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.bhavesh</groupId>
<artifactId>my-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>my-test</name>
<url>
http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>
junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>
test</scope>
</dependency>
</dependencies>
<distributionManagement>
<snapshotRepository>
<id>deployment1</id>
<name>Internal Releases</name>
<url>
http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>
-------------------------------------------------------------------------------------
The settings.xml has following:
<servers>
<server>
<id>deployment1</id>
<username>deployment</username>
<password>deployment123</password>
</server>
</servers>
Thanks,
Bob