The private server is an independent server, which is used to solve the problem of resource sharing and resource synchronization within the team.
1.Nexus
Nexus is a maven private server product of sonatype company.
1.1 Download address
https://help.sonatype.com/repomanager3/product-information/download
1.2 start
nexus.exe /run nexus
1.3 Access & Login
2. Private server warehouse classification
3. Resource upload and download
Local warehouse upload and access resources need to be configured.
①Create two warehouses demo-snapshot and demo-release
② Configure the permission to access the private server
<servers>
<!--配置访问私服权限-->
<server>
<id>demo-snapshot</id>
<username>admin</username>
<password>root</password>
</server>
<server>
<id>demo-release</id>
<username>admin</username>
<password>root</password>
</server>
</servers>
③ Configure private server access path
Still configured in the setting.xml file
<mirrors>
<!--私服的访问路径-->
<mirror>
<id>maven-public</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/repository/maven-public/</url>
</mirror>
</mirrors>
The configuration information is consistent with the maven-group warehouse group in the figure below, and the demo-snapshot and demo-release warehouses are added to the warehouse group.
④ Configure the specific location of the private server in the demo_aggregate project of the above article (pom.xml file)
<distributionManagement>
<snapshotRepository>
<id>demo-snapshot</id>
<url>http://localhost:8081/repository/demo-snapshot/</url>
</snapshotRepository>
<repository>
<id>demo-release</id>
<url>http://localhost:8081/repository/demo-release/</url>
</repository>
</distributionManagement>
⑤Upload
check it out