Two ways:
1. In connection address PW pom.xml single item, so that only work on the project.
2. Add the connection address PW setting.xml configuration of maven. This is for all projects.
This article demonstrates only the second method:
1. Make sure the nexus PW installation and startup.
2. modify the configuration files in native maven / conf / setting.xml.
Complete the following:
-
-
-
<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">
-
// maven repository location
-
<localRepository>D:\MAVEN_repository</localRepository>
-
-
<pluginGroups> </pluginGroups>
-
-
<proxies> </proxies>
-
// set permissions maven operation nexus
-
</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>
-
<server>
-
<id>3rd-proty</id>
-
<username>admin</username>
-
<password>admin123</password>
-
</server>
-
</servers>
-
// configure a mirror, so only use maven get PW
-
<mirrors>
-
<mirror>
-
<id>nexus</id>
-
<name>Nexus Repository</name>
-
<url>http://10.0.27.61:8081/content/groups/public</url>
-
<mirrorOf>*</mirrorOf>
-
</mirror>
-
</mirrors>
-
// Configure storage vehicles plugin Once you have configured mirroring, you can ignore this configuration
-
<profiles>
-
<profile>
-
<id>nexus</id>
-
<repositories>
-
<repository>
-
<id>nexus</id>
-
<url>http://10.0.27.61:8081/content/groups/public</url>
-
<releases>
-
<enabled>true</enabled>
-
</releases>
-
<snapshots>
-
<enabled>true</enabled>
-
</snapshots>
-
</repository>
-
</repositories>
-
<pluginRepositories>
-
<pluginRepository>
-
<id>nexus</id>
-
<url>http://10.0.27.61:8081/content/groups/public</url>
-
<releases>
-
<enabled>true</enabled>
-
</releases>
-
<snapshots>
-
<enabled>true</enabled>
-
</snapshots>
-
</pluginRepository>
-
</pluginRepositories>
-
</profile>
-
</profiles>
-
// activate the above configuration
-
<activeProfiles>
-
<activeProfile>nexus</activeProfile>
-
</activeProfiles>
-
-
</settings>