Hello Maven 3-Warehouse

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.