默认账户名:admin
密码:admin123
登录nexus可以发现nexus默认生成了一些仓库,可以直接使用
大家可以根据官方文档自行修改
https://books.sonatype.com/nexus-book/3.3/reference/maven.html#maven-sect-single-group
我下面提供一个能修改完毕的配置文件
<?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>D:\Program Files\maven\repository</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<!--配置nexus仓库认证信息-->
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/repository/maven-public/</url>
</mirror>
</mirrors>
<profiles>
<!-- maven 默认使用的 jdk 版本-->
<profile>
<id>nexus</id>
<!--使用代理中央存储库-->
<repositories>
<repository>
<id>oss2</id>
<url>http://127.0.0.1:8081/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>oss2</id>
<url>http://127.0.0.1:8081/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>nexus</id>
<name>Releases</name>
<url>http://localhost:8081/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>Snapshot</name>
<url>http://localhost:8081/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
<activation>
<jdk>1.7</jdk>
<activeByDefault>true</activeByDefault>
</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>
</profiles>
<!--激活Nexus仓库配置 -->
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>