mvn deploy:deploy-file -DgroupId=chinapay -DartifactId=chinapayfilesecure -Dversion=1.0 -Dpackaging=jar -Dfile=E:\repo\repository1\chinapay\chinapayfilesecure\1.0\chinapayfilesecure-1.0.jar -Durl=http://localhost:8081/repository/3rdParty/ -DrepositoryId=3rdParty
E:\repo\repository1\chinapay\chinapaysecure\1.0>mvn deploy:deploy-file -DgroupId=chinapay -DartifactId=chinapayfilesecure -Dversion=1.0 -Dpackaging=jar -Dfile=E:\repo\repository1\chinapay\chinapayfilesecure\1.0\chinapayfilesecure-1.0.jar -Durl=http://localhost:8081/repository/3rdParty/ -DrepositoryId=3rdParty
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) @ standalone-pom ---
Uploading: http://localhost:8081/repository/3rdParty/chinapay/chinapayfilesecure/1.0/chinapayfilesecure-1.0.jar
Uploading: http://localhost:8081/repository/3rdParty/chinapay/chinapayfilesecure/1.0/chinapayfilesecure-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.685 s
[INFO] Finished at: 2017-07-17T17:42:30+08:00
[INFO] Final Memory: 9M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact chinapay:chinapayfilesecure:jar:1.0 from/to 3rdParty (http://localhost:8081/repository/3rdParty/): Failed to transfer file: http://localhost:8081/repository/3rdParty/chinapay/chinapayfilesecure/1.0/chinapayfilesecure-1.0.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
E:\repo\repository1\chinapay\chinapaysecure\1.0>
已经解决,只要在maven的配置文件里面添加 这一行就可以了。