Installation of Nexus3
Down
URL:https://www.sonatype.com/nexus-repository-oss
Install
tar -zxvf nexus-3.24.0-02-unix.tar.gz
Configuration
vi ~/nexus3/etc/nexus-default.properties
## DO NOT EDIT - CUSTOMIZATIONS BELONG IN $data-dir/etc/nexus.properties
##
# Jetty section
application-port=8081
application-host=0.0.0.0
nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml
nexus-context-path=/
# Nexus section
nexus-edition=nexus-pro-edition
nexus-features=\
nexus-pro-feature
nexus.hazelcast.discovery.isEnabled=true
Start
cd ~/nexus3/bin
./nexus start|stop|restart|status
Login of Nexus3
nexus3的密码是第一次启动的时候生成的,文件在:~/sonatype-work/nexus3/admin.password
Repository Types
添加阿里云仓库
仓库名称:maven-aliyun
仓库类型:Release
Remote storage:https://maven.aliyun.com/nexus/content/groups/public/
Settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>~/apache-maven/repo</localRepository>
<pluginGroups></pluginGroups>
<proxies></proxies>
<servers>
<server>
<id>nexus3</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<!--配置你的私服地址,在<mirrors>中添加-->
<mirrors>
<!--此处配置所有的构建均从私有仓库中下载 *代表所有,也可以写central -->
<mirror>
<id>nexus3</id>
<name>nexus3</name>
<mirrorOf>*</mirrorOf>
<url>http://ip:8081/repository/maven-public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus3</id>
<repositories>
<repository>
<id>nexus3</id>
<url>http://ip:8081/repository/maven-public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories> <!-- 这里是插件仓库地址 -->
<pluginRepository>
<id>nexus3</id>
<url>http://ip:8081/repository/maven-public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<!-- 一定要激活
启用id为nexus3的profile的配置
-->
<activeProfiles>
<activeProfile>nexus3</activeProfile>
</activeProfiles>
</settings>