将本地jar包打包到本地仓库和上传到私服

1、本地jar打包到本地仓库

mvn install:install-file -Dfile=jar包完整地址或相对地址 -DgroupId=自定义的groupID -DartifactId=自定义的artifactid -Dversion=自定义版本号 -Dpackaging=jar  

如果上传时报错找不到pom文件,这是由于不同操作系统导致,可以将上面的命令参数加上引号,如下

mvn install:install-file "-Dfile=jar包完整地址或相对地址" "-DgroupId=自定义的groupID" "-DartifactId=自定义的artifactid" "-Dversion=自定义版本号" "-Dpackaging=jar"

2、本地jar上传到私服

1)、可以登录私服,导入jar

2)、也可以使用命令上传

mvn deploy:deploy-file -Dfile=jar包 -DgroupId=groupID -DartifactId=artifacid -Dversion=版本号 -Dpackaging=jar -Durl=http://ip:port/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty

猜你喜欢

转载自www.cnblogs.com/hujiapeng/p/9249965.html