Maven Repository, private warehouse settings (configure remote repositories in settings.xml)
1: Index update: Replace the downloaded Nexus-maven-repository-index.zip package with D:\Nexus\sonatype-work\nexus\indexer\central-ctx
If the factory is changed, then the index page needs to be replaced
2: Configure the image to overwrite the default address of the Central warehouse
<mirrors>
<mirror>
<id>central</id>
<mirrorOf>nexus</mirrorOf><!--If you want to mirror all the warehouses then you can change to:<mirrorof>*</mirrorof>-->
<name>human readable name for this mirror.</name>
<url>http://127.0.0.1:8081/nexus/content/groups/public/</url>
</mirror>
</mirros>
The configuration in the Pom.xml file is (without modifying the default configuration):
<repository>
<id>nexus</id>
<name>nexus repository</name>
<url>http://127.0.0.1:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
This means that all dependencies in our project will not be found in the URLs in the Pom.xml file, but instead will be found in the URL configured in our image.
Between the two is one by one corresponding to the correlation by ID.
3: If we delete the warehouse settings in our project Pom, then we have a default warehouse setting, but we do not support the release of the snapshot version.
If we modify this default configuration, we have to use profile. The following configuration:
In the settings.xml file of our local warehouse:
<profiles>
<profile>
<id>central-repos</id>
<repositories>
<repository>
<id>central</id>
<name>Central</name>
<url>http://central</url><!--This address is invalid because we've configured all the warehouses with mirrors--
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<activeProfiles>
<activeProfile>central-repos</activeProfile>
</activeProfiles>
4: With the above configuration we will be able to search for our project on the Nexus instead of looking for other online maven repositories