打开cmd命令提示符,mvn install是将jar包安装到本地库,mvn deploy是将jar包上传到远程server,install和deploy都会先自行bulid编译检查,如果确认jar包没有问题,可以使用-Dmaven.test.skip=true参数跳过编译和测试。 
全命令为:

mvn deploy:deploy-file -Dmaven.test.skip=true -Dfile=D:\work\scan\com.kevin.skeleton\target\skeleton-1.0.jar -DgroupId=hessian -DartifactId=skeleton -Dversion=1.0 -Dpackaging=jar -DrepositoryId=releases -Durl=http://192.168.0.202:8080/nexus/content/repositories/releases

mvn deploy:deploy-file -Dmaven.test.skip=true -Dfile=D:\MvnProject\service-mvn-1.0.0.jar -DgroupId=pri.roy.mvn.test -DartifactId=mvn-api -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -DrepositoryId=roy_privrepository_snapshots -Durl=http://10.4.71.144:9090/repository/roy_privrepository_snapshots/
1
-Dmaven.test.skip=true                              //跳过编译、测试
-Dfile=D:\MvnProject\service-mvn-1.0.0.jar          //jar包文件地址,绝对路径
-DgroupId=pri.roy.mvn.test                          //gruopId--pom坐标,自定义
-DartifactId=mvn-api                                //artifactId--pom坐标,自定义
-Dversion                                           //版本号
-Dpackaging                                         //打包方式
-DrepositoryId                                      //远程库服务器ID
-Durl                                               //远程库服务器地址

如:

mvn deploy:deploy-file -DgroupId=com.alipay -DartifactId=alipay-sdk-java -Dversion=20170725114550 -Dpackaging=jar-Dfile=D:\com\alipay\alipay-sdk-java\20170725114550\alipay-sdk-java-20170725114550.jar -Durl=http://XXXXXXXXX:8081/repository/obanks-releases/ -DrepositoryId=obanks-releases
<dependency><groupId>com.alipay</groupId><artifactId>alipay-sdk-java</artifactId><version>20170725114550</version>
</dependency>

 image.png