Nexus私服的搭建原理及教程解析
一.為什么要構(gòu)建Nexus私服?
公司所有開發(fā)成員沒有外網(wǎng),通過局域網(wǎng)連接 nexus 私服,由私服連接外網(wǎ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(對應(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 登錄后臺
在瀏覽器輸入 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 存放本地倉庫位置
http://127.0.0.1:8081 Nexus服務(wù)器ip及端口
admin/ admin123 Nexus服務(wù)器登錄用戶名和密碼
五.把項目發(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 中配置連接私服倉庫的用戶名和密碼
<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 右鍵項目-> run as 輸入 deploy
添加到項目后,后臺可查詢到對應(yīng)包

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Git客戶端TortoiseGit(Windows系統(tǒng))的使用方法
這篇文章主要介紹了Git客戶端TortoiseGit(Windows系統(tǒng))的使用方法,需要的朋友可以參考下2014-09-09
聯(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
使用cwRsync實現(xiàn)windows下服務(wù)器文件定時同步備份(附錯誤處理方法)
原來服務(wù)器一直用綠環(huán)ftp同步工具,發(fā)現(xiàn)一些大文件經(jīng)常無法同步,所以這里推薦使用cwRsync2012-06-06
無盤完美解決Windows Server 2012或2016無法安裝.NET Framework3.5的方法
今天小編就為大家分享一篇關(guān)于無盤完美解決Windows Server 2012或2016無法安裝.NET Framework3.5的方法,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧2019-03-03
Python和c++代碼實現(xiàn)高性能異構(gòu)分布式并行互聯(lián)系統(tǒng)
這篇文章主要介紹了Python和c++代碼實現(xiàn)高性能異構(gòu)分布式并行互聯(lián)系統(tǒng),包含通信模塊、任務(wù)調(diào)度模塊、數(shù)據(jù)管理模塊、負(fù)載均衡模塊、故障容錯模塊、性能優(yōu)化模塊、日志與監(jiān)控模塊,需要的朋友可以參考下2024-08-08
Centos中VNC遠(yuǎn)程桌面程序的安裝與使用教程
這篇文章主要介紹了Centos中VNC遠(yuǎn)程桌面程序的安裝與使用的方法,較為詳細(xì)的分析了CentOS的VNC遠(yuǎn)程桌面程序安裝、配置、連接、啟動等命令與相關(guān)操作技巧,需要的朋友可以參考下2016-07-07

