1、在setting.xml中的servers中加入
<server> <id>snapshots</id> <username>deployment</username> <password>123456</password> </server> <server> <id>releases</id> <username>deployment</username> <password>123456</password> </server>2、然后在项目的pom.xml中加入,这里的id要和server中的id一致
<distributionManagement> <snapshotRepository> <id>snapshots</id> <name>Internal Snapshots</name> <url>http://192.168.38.64/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project util-core: Failed to deploy artifac ts: Could not transfer artifact com.tiamaes.util:util-core:jar:1.0.1-20141017.060700-2 from/to snapshots (http://192.168.38.64/nexus/content/repositor ies/snapshots/): Failed to transfer file: http://192.168.38.64/nexus/content/repositories/snapshots/com/tiamaes/util/util-core/1.0.1-SNAPSHOT/util-cor e-1.0.1-20141017.060700-2.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 switch. [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 read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
mvn deploy:deploy-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=ojdbc.jar -Durl=http://192.168.38.64/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty
原文地址:http://blog.csdn.net/jaune161/article/details/44198089