Maven 打包项目到私服 (deploy)的配置方法

网友投稿 960 2023-05-12

Maven 打包项目到私服 (deploy)的配置方法

Maven 打包项目到私服 (deploy)的配置方法

一、配置maven

在maven安装目录 /conf/setting.xml 中的servers下添加:

nexus-snapshots

admin

123456

nexus-releases

admin

123456

二、配置pom

在maven工程的pom.xml配置部署的仓库,注意pom.xml和setting.xml中的id属性要一致

nexus-snapshots

tuohang-framework-SNAPSHOTS

http://47.100.xxx.xxx:30010/repository/3rd-part/

nexus-repository

tuohang-framework-REPOSITORY

http://47.100.xxx.xxx:30010/repository/3rd-part/

三、使用deploy命令上传

在项目路径下使用命令:

mvn deploy -Dmaven.test.skip=true

或者:mvn deploy:deploy-file -Dmaven.test.skip=true -Dfile=D:\workspace\com.xxx.test-1.0.0.jar -DgroupId=com.xxx -DartifactId=test -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -DrepositoryId=nexus-repository-Durl=http://192.168.xxx.xxx:9090/repository/3rd-part/

如图build success 代表成功。

四、使用

nexus-snapshots

http://47.100.xxx.xxx:30010/repository/3rd-part/

nexus-repository

http://47.100.xxx.xxx:30010/repository/3rd-part/

nexus-snapshots

http://47.100.xxx.xxx:30010/repository/3rd-part/

nexus-repository

http://47.100.xxx.xxx:30010/repository/3rd-part/

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:详解Maven打包和运行
下一篇:IDEA中使用Docker Compose容器编排的实现
相关文章

 发表评论

暂时没有评论,来抢沙发吧~