Nexus私服的搭建原理及教程解析
一.為什么要構(gòu)建Nexus私服?
公司所有開發(fā)成員沒有外網(wǎng),通過局域網(wǎng)連接 nexus 私服,由私服連接外網(wǎng)。
把項(xiàng)目發(fā)布到私服.其他人員從私服下載。
二.使用私服之后架構(gòu)圖
三.搭建 Nexus
3.1 nexus-2.10-1bundle.zip 解壓到任意非中文目錄中
3.2進(jìn)入 nexus-2.10-1\bin\jsw\indows-x86-4(對(duì)應(yīng)自己系統(tǒng))
以windows64系統(tǒng)為例
- instal-nexus.bat 安裝服務(wù)
- star-nexus.bat 開啟服務(wù)
- stop-nexus.bat 停止服務(wù)
- unistal-nexus.bat 卸載服務(wù)
3.3 登錄后臺(tái)
在瀏覽器輸入 htp:/localhost:8081/nexus
默認(rèn)端口8081
默認(rèn)用戶名admin
默認(rèn)密碼admin123
若需調(diào)整可配置nexus-2.10-1\conf\exus.proerties
四.使用 maven 連接私服
4.1修改maven 的 setings.xml
<?xml version="1.0" encoding="UTF-8"?> <settings> <localRepository>G:\tool\m2\myrepository</localRepository> <mirrors> <mirror> <id>nexus-releases</id> <mirrorOf>*</mirrorOf> <url>http://localhost:8081/nexus/content/groups/public</url> </mirror> <mirror> <id>nexus-snapshots</id> <mirrorOf>*</mirrorOf> <url>http://localhost:8081/nexus/content/repositories/apache-snapshots/ </url> </mirror> </mirrors> <profiles> <profile> <id>jdk-1.7</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.7</jdk> </activation> <properties> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion> </properties> </profile> <profile> <id>nexusTest</id> <repositories> <repository> <id>local-nexus</id> <url>http://127.0.0.1:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles> <activeProfiles> <!--激活 id為 nexusTest的 profile --> <activeProfile>nexusTest</activeProfile> </activeProfiles> <servers> <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server> </servers> </settings>
G:\tool\m2\myrepository 存放本地倉(cāng)庫(kù)位置
http://127.0.0.1:8081 Nexus服務(wù)器ip及端口
admin/ admin123 Nexus服務(wù)器登錄用戶名和密碼
五.把項(xiàng)目發(fā)布到私服的步驟
5.1 pom.xml 中配置私服路徑
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.bjsxt</groupId> <artifactId>test</artifactId> <version>0.0.1-SNAPSHOT</version> <distributionManagement> <repository> <id>releases</id> <url>http://localhost:8081/nexus/content/repositories/releases</url> </repository> <snapshotRepository> <id>snapshots</id> <url>http://localhost:8081/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement> </project>
5.2 在 setings.xml 中配置連接私服倉(cāng)庫(kù)的用戶名和密碼
<servers> <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server> </servers>
5.3 右鍵項(xiàng)目-> run as 輸入 deploy
添加到項(xiàng)目后,后臺(tái)可查詢到對(duì)應(yīng)包
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
ServerSocket默認(rèn)邦定IP實(shí)現(xiàn)過程詳解
這篇文章主要介紹了ServerSocket默認(rèn)邦定IP實(shí)現(xiàn)過程詳解,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-10-10Windows遠(yuǎn)程數(shù)據(jù)、文件同步工具cwRsync配置方法
這篇文章主要介紹了Windows遠(yuǎn)程數(shù)據(jù)、文件同步工具cwRsync配置方法,需要的朋友可以參考下2015-10-10Ajenti開源免費(fèi)的服務(wù)器管理面板和Ajenti V虛擬主機(jī)面板及安裝與使用詳細(xì)教程
Ajenti是國(guó)外一個(gè)功能非常強(qiáng)大的輕型的Linux服務(wù)器管理面板,采用Python架構(gòu),修改擴(kuò)展非常簡(jiǎn)單,Ajenti V是Ajenti一個(gè)虛擬主機(jī)管理面板插件,下面通過本文給大家介紹Ajenti開源免費(fèi)的服務(wù)器管理面板和Ajenti V虛擬主機(jī)面板及安裝與使用詳細(xì)教程,一起看看吧2017-07-07Python和c++代碼實(shí)現(xiàn)高性能異構(gòu)分布式并行互聯(lián)系統(tǒng)
這篇文章主要介紹了Python和c++代碼實(shí)現(xiàn)高性能異構(gòu)分布式并行互聯(lián)系統(tǒng),包含通信模塊、任務(wù)調(diào)度模塊、數(shù)據(jù)管理模塊、負(fù)載均衡模塊、故障容錯(cuò)模塊、性能優(yōu)化模塊、日志與監(jiān)控模塊,需要的朋友可以參考下2024-08-08vscode內(nèi)網(wǎng)訪問服務(wù)器的方法
這篇文章主要介紹了vscode內(nèi)網(wǎng)訪問服務(wù)器的相關(guān)知識(shí),本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2022-06-06基于注解的Dubbo服務(wù)配置方法(實(shí)例講解)
下面小編就為大家?guī)硪黄谧⒔獾腄ubbo服務(wù)配置方法(實(shí)例講解)。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-06-06Linux 系統(tǒng)下搭建 Gitlab 服務(wù)器的過程分析
這篇文章主要介紹了Linux 系統(tǒng)下搭建 Gitlab 服務(wù)器的過程,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-04-04聯(lián)想服務(wù)器RD450 配置RAID5陣列圖文方法
聯(lián)想RD450是一款服務(wù)器,cpu為英特爾 至強(qiáng) 處理器六核E5-2609 v3 1.9GHz,這里為大家分享一下聯(lián)想服務(wù)器RD450 配置RAID5陣列圖文方法,需要的朋友可以參考下2018-05-05