Local Warehouse
Central Warehouse
Private Servers
Third-party warehouses
Where is the configuration of the Central warehouse?
Decompression $m2_home/lib/maven-model-builder-3.0.jar
Find Org/apache/maven/model/pom-4.0.0.xml and you can see
Configuration of remote warehouses
In the project's Pom file
<Project> ... <repositories> <Repository> <ID>Jboss</ID> <name>JBoss Repository</name> <URL>http://repository.jboss.com/maven2/</URL> <releases> <enabled>True</enabled> </releases> <Snapshots> <enabled>True</enabled> <Updatepolicy>Daily</Updatepolicy> <Checksumpolicy>Ignore</Checksumpolicy> </Snapshots> <Layout>Default</Layout> </Repository> </repositories></Project>
Updatepolicy-Check frequency of snapshots never,always,interval:x (minutes)
Checksumpolicy [Warn|fail|ignore]-maven examines inspection and file policies: When a build is deployed to a warehouse, the corresponding checksum files are deployed simultaneously. MAVEN validates checksum files while downloading artifacts
Certification of remote repositories
In the Settings.xml
<Settings> ... <Servers> <Server> <ID>Proj-releases</ID> <username>User</username> <Password>123456</Password> </Server> </Servers> ...</Settings>
Deploy to remote warehouses
In the project's Pom file
<Project> ... <distributionmanagement> <Repository> <ID>Proj-releases</ID> <name>Proj Release Repository</name> <URL>Http://192.168.1.100/content/repositories/proj-releases</URL> </Repository> <snapshotrepository> <ID>Proj-snapshots</ID> <name>Proj Snapshots Repository</name> <URL>Http://192.168.1.100/content/repositories/proj-releases</URL> </snapshotrepository> </distributionmanagement> ...</Project>
Run Command MVN clean deploy
Mirror
In the Settings.xml
<Settings> ... <Mirrors> <Mirror> <ID>Nexus</ID> <name>Nexus</name> <URL>Http://124.42.125.69:8998/nexus/content/groups/public</URL> <mirrorof>*</mirrorof> </Mirror> </Mirrors> ...</Settings>
* Match all remote repositories
external:* matches all remote warehouses except those using localhost://or file://
REPO1,REPO2 Matching REPO1 and Repo2
*,! REPO1 matches all remote warehouses, except REPO1
Hello Maven 3-Warehouse