I get error 401 when deploying to a nexus. I do not make any changes to the established connection. Nexus runs on localhost:8080/nexus , and I can log in using the default user / password. When I run mvn deploy , I get this error.
Here is my POM.
<groupId>testproject</groupId> <artifactId>testproject</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>testproject</name> <url>http://maven.apache.org</url> <distributionManagement> <repository> <id>releases</id> <url>http://localhost:8080/nexus/content/repositories/releases</url> </repository> <snapshotRepository> <id>snapshots</id> <url>http://localhost:8080/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement> <dependencies> ......... </dependencies>
and ~ / .m2 / settings.xml
<servers> <server> <id>snapshots</id> <username>deployment</username> <password>deployment123</password> </server> <server> <id>releases</id> <username>deployment</username> <password>deployment123</password> </server> </servers>
An exception:
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default- deploy) on project testproject: Failed to deploy artifacts: Could not transfer artifact testproject:testproject:jar:1.0-20131213.150615-1 from/to snapshots (http://localhost:8080/nexus/content/repositories/snapshots): Failed to transfer file: http://localhost:8080/nexus/content/repositories/snapshots/testproject/testproject/1.0-SNAPSHOT/testproject-1.0-20131213.150615-1.jar. Return code is: 401 -> [Help 1]
Please help me.
source share