Maven 打包項(xiàng)目到私服 (deploy)的配置方法
一、配置maven
在maven安裝目錄 /conf/setting.xml 中的servers下添加:
<servers> <server> <id>nexus-snapshots</id> <username>admin</username> <password>123456</password> </server> <server> <id>nexus-releases</id> <username>admin</username> <password>123456</password> </server> </servers>
二、配置pom
在maven工程的pom.xml配置部署的倉(cāng)庫(kù),注意pom.xml和setting.xml中的id屬性要一致
<!-- 發(fā)布maven私服 --> <distributionManagement> <repository> <id>nexus-snapshots</id> <name>tuohang-framework-SNAPSHOTS</name> <url>http://47.100.xxx.xxx:30010/repository/3rd-part/</url> </repository> <snapshotRepository> <id>nexus-repository</id> <name>tuohang-framework-REPOSITORY</name> <url>http://47.100.xxx.xxx:30010/repository/3rd-part/</url> </snapshotRepository> </distributionManagement>
三、使用deploy命令上傳
在項(xiàng)目路徑下使用命令:
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 代表成功。
四、使用
<!-- 遠(yuǎn)程nexus倉(cāng)庫(kù) --> <repositories> <repository> <id>nexus-snapshots</id> <url>http://47.100.xxx.xxx:30010/repository/3rd-part/</url> </repository> <repository> <id>nexus-repository</id> <url>http://47.100.xxx.xxx:30010/repository/3rd-part/</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus-snapshots</id> <url>http://47.100.xxx.xxx:30010/repository/3rd-part/</url> </pluginRepository> <pluginRepository> <id>nexus-repository</id> <url>http://47.100.xxx.xxx:30010/repository/3rd-part/</url> </pluginRepository> </pluginRepositories>
到此這篇關(guān)于Maven 打包項(xiàng)目到私服 (deploy)的文章就介紹到這了,更多相關(guān)Maven 打包項(xiàng)目到私服內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- 利用maven deploy上傳本地jar至私服的方法
- 關(guān)于使用mvn deploy命令將本地jar包上傳到maven私服的問題(收藏)
- 多模塊maven的deploy集成gitlab?ci自動(dòng)發(fā)版配置
- maven 在執(zhí)行package,install,deploy時(shí)使用clean與不使用clean的不同之處
- maven deploy時(shí)報(bào)錯(cuò)的解決方法
- Maven deploy配置方法詳解
- 理解maven命令package、install、deploy的聯(lián)系與區(qū)別
- Maven deploy plugin使用方式
相關(guān)文章
SpringFox實(shí)現(xiàn)自動(dòng)生成RESTful?API文檔
在開發(fā)?RESTful?API?時(shí),編寫?API?文檔是一個(gè)重要的任務(wù),這篇文章為大家介紹了如何使用?SpringFox?自動(dòng)生成?RESTful?API?文檔,并提供示例代碼,需要的可以參考一下2023-06-06SpringBoot日志框架之Log4j2快速入門與參數(shù)詳解
本文介紹了SpringBoot日志框架log4j2的基本使用和配置方法,包括將日志輸出到控制臺(tái)、文件、Elasticsearch和Kafka,多個(gè)輸出目的地的配置,異步日志記錄器的使用以及l(fā)og4j2.xml配置文件的詳細(xì)語(yǔ)法和參數(shù)含義,需要的朋友可以參考下2023-05-05Mybatis通過(guò)數(shù)據(jù)庫(kù)表自動(dòng)生成實(shí)體類和xml映射文件
這篇文章主要介紹了Mybatis通過(guò)數(shù)據(jù)庫(kù)表自動(dòng)生成實(shí)體類和xml映射文件的操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2021-07-07java實(shí)現(xiàn)簡(jiǎn)易版圖形界面計(jì)算器
這篇文章主要為大家詳細(xì)介紹了java實(shí)現(xiàn)簡(jiǎn)易版圖形界面計(jì)算器,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-05-05Spring AOP面向切面編程實(shí)現(xiàn)原理方法詳解
這篇文章主要介紹了Spring AOP面向切面編程實(shí)現(xiàn)原理方法詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-08-08基于雪花算法實(shí)現(xiàn)增強(qiáng)版ID生成器詳解
這篇文章主要為大家詳細(xì)介紹了如何基于雪花算法實(shí)現(xiàn)增強(qiáng)版ID生成器,文中的示例代碼講解詳細(xì),對(duì)我們學(xué)習(xí)具有一定的借鑒價(jià)值,需要的可以了解一下2022-10-10Java整合Redis實(shí)現(xiàn)坐標(biāo)附近查詢功能
這篇文章主要介紹了Java整合Redis實(shí)現(xiàn)坐標(biāo)附近查詢,我們可以在redis服務(wù)器使用命令 help xxx 查看指令的具體用法,本文給大家介紹的非常詳細(xì),感興趣的朋友一起看看吧2023-11-11Java實(shí)戰(zhàn)項(xiàng)目 圖書管理系統(tǒng)
這篇文章主要介紹了使用java SSM jsp mysql maven設(shè)計(jì)實(shí)現(xiàn)的精品圖書管理系統(tǒng),是一個(gè)很好的實(shí)例,對(duì)大家的學(xué)習(xí)和工作具有借鑒意義,建議收藏一下2021-09-09Mybatis-plus中QueryWrapper的多種用法小結(jié)
本文主要介紹了Mybatis-plus中QueryWrapper的多種用法小結(jié),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2023-04-04