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

首頁(yè) > 服務(wù)器 > Web服務(wù)器 > 正文

nexus服務(wù)器搭建的詳細(xì)步驟

2024-09-01 13:55:36
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

一、搭建nexus服務(wù)的意義

作為內(nèi)網(wǎng)的統(tǒng)一代理,團(tuán)隊(duì)合作開(kāi)發(fā)時(shí)不用每人都去外網(wǎng)下載一次;

解決部分變態(tài)公司內(nèi)網(wǎng)管制無(wú)法訪問(wèn)外網(wǎng)的問(wèn)題,選一臺(tái)有外網(wǎng)權(quán)限的機(jī)器搭建服務(wù)器,其余人直接內(nèi)網(wǎng)訪問(wèn)此服務(wù);

團(tuán)隊(duì)合作開(kāi)發(fā)時(shí)解決maven項(xiàng)目依賴(lài)問(wèn)題;

二、安裝nexus

# 下載安裝包:wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.14.4-03-bundle.tar.gz# 解壓mkdir /data/appscd /data/appstar -zxvf ~/nexus-2.14.4-03-bundle.tar.gz

三、配置nexus

編輯配置文件:vim conf/nexus.properties

# Jetty sectionapplication-port=8081   # 訪問(wèn)端口application-host=0.0.0.0  # 綁定IPnexus-webapp=${bundleBasedir}/nexus  # 指定nexus程序目錄nexus-webapp-context-path=/nexus   # 指定訪問(wèn)的二組目錄# Nexus sectionnexus-work=${bundleBasedir}/../sonatype-work/nexusruntime=${bundleBasedir}/nexus/WEB-INF

以上都是默認(rèn)配置,對(duì)應(yīng)的訪問(wèn)地址為: http://x.x.x.x:8081/nexus

如果要改為http://x.x.x.x:8081,則修改nexus-webapp-context-path=/即可

四、啟動(dòng)nexus

啟動(dòng)腳本:bin/nexus

# 啟動(dòng)腳本有如下參數(shù)可選[root@ci-gitlab nexus-2.14.4-03]# bin/nexusUsage: ./nexus { console | start | stop | restart | status | dump }

注意:nexus采用wrapper做為WEB容器,nexus只是shell腳本,最終會(huì)調(diào)用jsw目錄下對(duì)應(yīng)平臺(tái)中的wrapper二進(jìn)制文件

五、管理nexus

1. 默認(rèn)的用戶(hù):

admin/admin123 deployment/deployment123

2. 修改用戶(hù)信息

admin登陸后,點(diǎn)擊左側(cè)【Security–Users】,在列表中選擇用戶(hù),右鍵可更改密碼和重圍密碼, 底部表格中可修改用戶(hù)其余信息

六、在項(xiàng)目中使用nexus

1. 作為插件庫(kù)

點(diǎn)擊左側(cè)【Views/Repositories–Repositories】,選擇【Public Repositories】,復(fù)制其Repository Path字段 
編輯pom.xml文件,添加如下段:

<!-- 設(shè)定主倉(cāng)庫(kù),按設(shè)定順序進(jìn)行查找。 --><!-- 設(shè)定主倉(cāng)庫(kù),按設(shè)定順序進(jìn)行查找。 -->  <repositories>    <repository>      <id>releases</id>      <name>Team Nexus Repository</name>      <url>${Repository Path}</url>    </repository>    <repository>      <id>snapshots</id>      <name>Team Nexus Repository</name>      <url>${Repository Path}</url>    </repository>  </repositories>

2. 作為deploy庫(kù)

點(diǎn)擊左側(cè)【Views/Repositories–Repositories】,選擇【 Release 或 Snapshots】,復(fù)制其Repository Path字段 
編輯pom.xml文件,添加如下段:

<!-- 設(shè)定發(fā)布位置,mvn deploy時(shí)用到,不設(shè)置時(shí)會(huì)報(bào)錯(cuò)-->  <distributionManagement>    <repository>      <id>ci-releases</id>      <name>Gigold Nexus Repository</name>      <url>http://ci-gitlab:8081/content/repositories/releases</url>    </repository>    <snapshotRepository>      <id>ci-snapshots</id>      <name>Gigold Nexus Repository</name>      <url>http://ci-gitlab:8081/content/repositories/snapshots/</url>    </snapshotRepository>  </distributionManagement>

注意:不設(shè)置distributionManagement段,執(zhí)行mvn deploy會(huì)報(bào)如下錯(cuò)誤:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project helloworld-a: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持VEVB武林網(wǎng)。


注:相關(guān)教程知識(shí)閱讀請(qǐng)移步到服務(wù)器教程頻道。
發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 金乡县| 龙游县| 岚皋县| 文成县| 七台河市| 巴林右旗| 赣榆县| 海林市| 托里县| 枣阳市| 达州市| 呼和浩特市| 吉林市| 汶川县| 噶尔县| 东港市| 滁州市| 长乐市| 周宁县| 顺昌县| 洪泽县| 奉节县| 古田县| 营山县| 大化| 玉屏| 安吉县| 石首市| 揭东县| 班戈县| 句容市| 栾川县| 桓台县| 嵩明县| 平和县| 灵台县| 平湖市| 周宁县| 胶南市| 普兰县| 府谷县|