国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

Nexus使用說(shuō)明

2019-11-11 00:04:26
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

一、項(xiàng)目使用nexus私服的jar包,在項(xiàng)目的pom.xml文件中指定私服倉(cāng)庫(kù)

<repositories> <repository> <id>nexus</id> <name>nexus</name> <url>http://10.10.1.77:8088/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository></repositories>

二、項(xiàng)目使用nexus私服的插件,在項(xiàng)目的pom.xml文件中指定插件倉(cāng)庫(kù)

<pluginRepositories> <pluginRepository> <id>nexus</id> <name>nexus</name> <url>http://10.10.1.77:8088/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository></pluginRepositories>

三、如果想本機(jī)所有的maven項(xiàng)目都使用私服的組件,可以在maven的設(shè)置文件settings.xml中添加屬性,并激活

<PRofiles> <profile> <id>nexusProfile</id> <repositories> <repository> <id>nexus</id> <name>nexus</name> <url>http://10.10.1.77:8088/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile></profiles><!-- 激活 --><activeProfiles> <activeProfile>nexusProfile</activeProfile></activeProfiles>

四、 項(xiàng)目發(fā)布到私服,maven項(xiàng)目使用命令:mvn clean deploy;需要在pom文件中配置一下代碼

<distributionManagement> <repository> <id>user-release</id> <name>User Project Release</name> <url>http://192.168.1.103:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>user-snapshots</id> <name>User Project SNAPSHOTS</name> <url>http://192.168.1.103:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>

五、注意還需要配置mvn發(fā)布的權(quán)限,否則會(huì)報(bào)401錯(cuò)誤,在settings.xml中配置權(quán)限,其中id要與pom文件中的id一致

<server> <id>user-release</id> <username>admin</username> <passWord>admin123</password></server><server> <id>user-snapshots</id> <username>admin</username> <password>admin123</password></server>

六、發(fā)布成功后,可以在nexus中看到 這里寫(xiě)圖片描述 七、 上傳第三方的jar包,選擇3rd party–>Artifact Upload–> 選擇GAV方式–>填好構(gòu)建參數(shù)–>增加jar包–>上傳,在Browse Storeage查看 這里寫(xiě)圖片描述 這里寫(xiě)圖片描述 八、手動(dòng)把Jar包構(gòu)件發(fā)布到maven私服 1、自己創(chuàng)建一個(gè)批處理文件 2、批處理文件內(nèi)容

mvn deploy:deploy-file -DgroupId=com.alan.maven -DartifactId=MavenDemo -Dversion=0.0.1 -Dpackaging=jar -Dfile=MavenDemo-0.0.1.jar -Durl=http://10.10.1.77:8088/nexus/content/repositories/thirdparty -DrepositoryId=thirdparty

注:批處理文件在文本編輯器格式中不要自動(dòng)換行,一行完成,免得換行造成錯(cuò)誤,自己看不到 Jar包說(shuō)明: -DgroupId和-DartifactId構(gòu)成了該jar包在pom.xml的坐標(biāo),項(xiàng)目就是依靠這兩個(gè)屬性定位。自己起名字也行。 -Dversion:不能出現(xiàn)-快照snapshots等英文字符,必須為0.0.1類(lèi)型的數(shù)字,否則手動(dòng)上傳不成功。 -Dfile:表示需要上傳的jar包的絕對(duì)路徑。 如:E:/Users/LD-01 注:路徑中一定不能有空格 Durl私服上倉(cāng)庫(kù)的位置,打開(kāi)nexus——>repositories菜單,可以看到該路徑。

注:手動(dòng)上傳Jar包構(gòu)件一定要在本地客戶(hù)端配置Maven權(quán)限,在Maven配置文件setting設(shè)置($MAVEN/conf/settings.xml)。 這里寫(xiě)圖片描述


發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 祁连县| 广昌县| 永春县| 阳原县| 西畴县| 刚察县| 文安县| 莱州市| 漳浦县| 翁牛特旗| 浦东新区| 繁峙县| 昌黎县| 湖南省| 辛集市| 双城市| 林州市| 喀什市| 霞浦县| 安阳市| 西盟| 巩义市| 平武县| 竹山县| 甘谷县| 准格尔旗| 农安县| 牙克石市| 银川市| 独山县| 夏津县| 巴马| 汉源县| 靖江市| 乐业县| 两当县| 壤塘县| 恩平市| 陈巴尔虎旗| 保康县| 营口市|