maven指令上传jar到nexus仓库

1、通过maven指令上传

mvn deploy:deploy-file 
-DgroupId=com.json 
-DartifactId=json -Dversion=1.18 -Dpackaging=jar
-Dfile=D:\repository\com\json\json-1.18.jar
-Durl=http://localhost:8081/repository/releases/ -DrepositoryId=releases

命令中的参数解释:

-DgroupId=com.json                           包路径
-DartifactId=json                             jar包名
-Dversion=1.18                              jar包版本
-Dpackaging=jar                              上传的类型是jar类型
-Dfile=D:\repository\com\json\json-1.18.jar                jar的本地磁盘位置
-Durl=http://localhost:8081/repository/releases/            远程nexus仓库地址
-DrepositoryId=releases                                       setting.xml文件中配置的ID或者仓库对应的id

1.如果本地上传的是pom需增加参数指定打包形式为pom,默认为jar方式
-Dpackaging=pom

你可能感兴趣的:(jar,maven,java)