栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

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

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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:workspacecom.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/
    
  

到此这篇关于Maven 打包项目到私服 (deploy)的文章就介绍到这了,更多相关Maven 打包项目到私服内容请搜索考高分网以前的文章或继续浏览下面的相关文章希望大家以后多多支持考高分网!

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/133150.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号