b Local Project area when downloading the rack package, the order is: local warehouse storage folder → local (nexus) → Central Warehouse
We can set this in the settings.xml in Maven
<profiles><!--Configure our own factory--<profile> <id>nexusProfile</id> <repositories> <repository> <id>test</id> <name>nexus</name> <URL&G T;http://localhost:8081/nexus/content/groups/public/</url><!--can download releases's rack package, which is open by default--<releases> <enabled>true</enabled> </releases> <!--can download snapshots's rack package, which is off by default and <SNAPSHOTS&G T <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> <!--this side rewrite the central information--<profile> <id>mycentral</id> <repositorie s> <repository> <id>central</id> <name>central repository</name> <url>http://rep</url><layout>default</layout> <snapshots> <!--The original default is False. Now that it's changed to true, the configuration in the rack is invalid. @--> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles> <!--to activate the above profile--> <activeProfiles> <activeProfile>mycentral< /activeprofile> </activeProfiles>
And we want to set up a mirror, so that regardless of the download of any type of rack package, will go through this image to our local download, if not downloaded, will automatically go to the central warehouse to download
<mirrors> <!--Mirror|specifies a repository mirror site to use instead of a given repository. The repository that| ThisMirror serves has a ID that matches the mirrorof element of ThisMirror. IDs is used| forInheritance and direct lookup purposes, and must be unique across theSetof mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>huma N Readable Name for ThisMirror.</name> <url>http://my.repository.com/repo/path</url></mirror> <!--factory image, as long as the factory in Mirrorof to access, will automatically look for the mirror, if the mirror is not accessible to the central factory to download--<mirror> <id>nexusMirror</id> <!--use * indicates that all of them come here to visit, so that you can remove Activeprofiles-<mirrorof>*</mi rrorof> <name>human readable name for ThisMirror.</name> <url>http://localhost:8081/nexus/content/groups/public/</url></mirror> </mirrors>
How to get local projects to visit our