日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

eclipse maven访问maven私有库

發(fā)布時間:2025/3/11 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 eclipse maven访问maven私有库 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1、Windows本地maven下載

https://maven.apache.org/download.cgi


2、maven setting 文件配置

進(jìn)入maven 目錄下 conf。apache-maven-3.2.3\conf

新建.xml 文件,內(nèi)容如下:

<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"><localRepository>D:/ProgrammeJar/dubbo-web-project</localRepository><!--配置權(quán)限,使用默認(rèn)用戶--><servers><server><id>ZmgRelease</id><username>zengmiaogen</username><password>123456</password></server><server> <id>ZmgSnapshot</id><username>zengmiaogen</username><password>123456</password></server></servers><mirrors></mirrors><profiles><profile><id>dubbo-web</id><repositories><!-- 私有庫地址--><repository><id>nexus</id><url>http://192.168.78.132:8081/nexus/content/groups/public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories><pluginRepositories><!--插件庫地址--><pluginRepository><id>nexus</id><url>http://192.168.78.132:8081/nexus/content/groups/public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></pluginRepository></pluginRepositories></profile></profiles><!--激活profile--><activeProfiles><activeProfile>dubbo-web</activeProfile></activeProfiles></settings>
上面配置文件的私有庫和用戶賬號已經(jīng)事先建好。

參見文章:

maven私有庫搭建

maven私有庫配置


3、eclipse maven 插件配置



4、項(xiàng)目父級(根)項(xiàng)目的pom.xml配置

如我的項(xiàng)目,在admin-parent項(xiàng)目的pom.xml中增加如下配置:

<distributionManagement><repository><id>ZmgRelease</id><name>Releases</name><url>http://192.168.78.132:8081/nexus/content/repositories/ZmgRelease/</url></repository><snapshotRepository><id>ZmgSnapshot</id><name>Snapshots</name><url>http://192.168.78.132:8081/nexus/content/repositories/ZmgSnapshot/</url></snapshotRepository></distributionManagement>
配置中的id,要和maven的配置文件一致。

url可以在Sonatype Nexus 的管理平臺里查到。


5、發(fā)布項(xiàng)目包到私有庫。

選中要發(fā)布的項(xiàng)目的pom.xml。右鍵--Run As --- Maven build

輸入:

clean install deploy


命令中:

install 是生成jar包安裝到本地庫。

deploy是發(fā)布到私有庫的命令。


本地庫:



私有庫:



完成!


總結(jié)

以上是生活随笔為你收集整理的eclipse maven访问maven私有库的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。