这篇文章主要介绍了Maven 打包项目到私服 (deploy)的配置方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
一、配置maven
在maven安装目录 /conf/setting.xml 中的servers下添加:
nexus-snapshotsadmin123456 nexus-releasesadmin123456
二、配置pom
在maven工程的pom.xml配置部署来源gaodai$ma#com搞$代*码*网的仓库,注意pom.xml和setting.xml中的id属性要一致
<!-- 发布maven私服 --> nexus-snapshotstuohang-framework-SNAPSHOTShttp://47.100.xxx.xxx:30010/repository/3rd-part/ nexus-repositorytuohang-framework-REPOSITORYhttp://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仓库 --> nexus-snapshotshttp://47.100.xxx.xxx:30010/repository/3rd-part/ nexus-repositoryhttp://47.100.xxx.xxx:30010/repository/3rd-part/ nexus-snapshotshttp://47.100.xxx.xxx:30010/repository/3rd-part/ nexus-repositoryhttp://47.100.xxx.xxx:30010/repository/3rd-part/
到此这篇关于Maven 打包项目到私服 (deploy)的文章就介绍到这了,更多相关Maven 打包项目到私服内容请搜索gaodaima搞代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持gaodaima搞代码网!
以上就是Maven 打包项目到私服 (deploy)的配置方法的详细内容,更多请关注gaodaima搞代码网其它相关文章!