sudo mkdir /usr/local/nexus
sudo chown -R wh.wh nexus
tar -zxvf nexus-3.5.1-02-unix.tar.gz
刪除安裝包緩存
rm nexus-3.5.1-02-unix.tar.gz
cd bin ./nexus start
./nexus stop
查看服務狀態maven
./nexus status
重啓url
./nexus restart
1.倉庫類型共四種:group(倉庫組)spa
hosted(宿主).net
proxy(代理)代理
virtual(虛擬)unix
<!-- Nexus私服 --> <repositories> <repository> <id>nexus</id> <name>Nexus</name> <url>http://192.168.15.49:8081/repository/maven-public/</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>Nexus</name> <url>http://192.168.15.49:8081/repository/maven-public/</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </pluginRepository> </pluginRepositories>
<!--配置鏡像--> <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://192.168.15.49:8081/repository/maven-public/</url> </mirror>
部署構件至Nexusrest
<distributionManagement> <repository> <id>nexus-releases</id> <name>Nexus Release Repository</name> <url>http://192.168.15.49:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>Nexus Snapshot Repository</name> <url>http://192.168.15.49:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
(Nexus的倉庫對於匿名用戶是隻讀的,爲了可以部署構件,還要在settings.xml中配置認證信息)日誌
<servers> <server> <id>nexus-releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>nexus-snapshots</id> <username>admin</username> <password>admin123</password> </server> </servers>