1.下载安装nexus oos

https://www.sonatype.com/download-oss-sonatype ,选择2.x 版本。

2. 配置maven

  <server>
<!-- 发布版本库 -->
<id>release</id>
<username>admin</username>
<password>admin123</password>
</server> <server>
<!-- 测试版本库 -->
<id>snapshot</id>
<username>admin</username>
<password>admin123</password>
</server> <!-- 配置代理 库-->
<mirror>
<id>nexus</id>
<!-- 除了本地库,都请求远程代理 -->
<mirrorOf>*,!local-nexus</mirrorOf>
<url>http://localhost:8081/nexus/content/repositories/test/</url>
</mirror> <!-- 配置默认jdk1.8编译和编译源码编码还有本地仓库 -->
<profile>
<id>jdk1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> <encoding>UTF-8</encoding>
</properties> <repositories>
<!-- 配置本地公共仓库 -->
<repository>
<id>local-nexus</id>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>

3.over,请使用

05-11 19:23