"Maven" Nexus Configuration and use

Source: Internet
Author: User

Nexus installation

Nexus installation, can be referred to: "Maven" Nexus (MAVEN) Download and installation

Nexus Simple Description
    • Purpose: Specify the central address of the IP, assign your MAVEN project to the address, download the project index from the Central Library, download the dependent component from the repository, upload the third-party project Jar to the other project group for use
    • Warehouse:

Hosted type of warehouse, internal project release warehouse

Release repository for the release module in the releases internal module

Snapshots Release the warehouse of the internal snapshot module

3rd The third party relies on the warehouse, this data is usually downloaded by the internal personnel after the release

Proxy type of warehouse, from the remote central warehouse to find the Data Warehouse

A warehouse of group type that is used by the warehouse to facilitate the setup of our developers.

      

Nexus Configuration

Most of the Nexus configuration uses the default configuration, mainly to configure a project index

Select Central Warehouse, set download Remote indexes:true

  

Nexus use
  • The project uses a Nexus jar package to specify the database in the project's Pom.xml file
    1 <repositories>2     <Repository>3         <ID>Nexus</ID>4         <name>Nexus</name>5         <URL>http://192.168.1.103:8081/nexus/content/groups/public/</URL>6         <releases>7             <enabled>True</enabled>8         </releases>9         <Snapshots>Ten             <enabled>True</enabled> One         </Snapshots> A     </Repository> - </repositories>

  • The project uses a Nexus plug-in to specify the plugin repository in the project's Pom.xml file
    1 <pluginrepositories>2     <pluginrepository>3         <ID>Nexus</ID>4         <name>Nexus</name>5         <URL>http://192.168.1.103:8081/nexus/content/groups/public/</URL>6         <releases>7             <enabled>True</enabled>8         </releases>9         <Snapshots>Ten             <enabled>True</enabled> One         </Snapshots> A     </pluginrepository> - </pluginrepositories>

  • If you want all of the MAVEN projects on this machine to use the component, you can add properties to Maven's settings file settings.xml and activate
    1 <Profiles>2     < Profile>3         <ID>Nexusprofile</ID>4         <repositories>5             <Repository>6                 <ID>Nexus</ID>7                 <name>Nexus</name>8                 <URL>http://192.168.1.103:8081/nexus/content/groups/public/</URL>9                 <releases>Ten                     <enabled>True</enabled> One                 </releases> A                 <Snapshots> -                     <enabled>True</enabled> -                 </Snapshots> the             </Repository> -         </repositories> -     </ Profile> - </Profiles> + <!--Activate - - <Activeprofiles> +     <Activeprofile>Nexusprofile</Activeprofile> A </Activeprofiles>

  • Project to the use of the MAVEN Project command: mvn clean deploy; you need to configure the code in the Pom file;
    1 <distributionmanagement>2         <Repository>3             <ID>User-release</ID>4             <name>User Project Release</name>5             <URL>http://192.168.1.103:8081/nexus/content/repositories/releases/</URL>6         </Repository>7 8         <snapshotrepository>9             <ID>User-snapshots</ID>Ten             <name>User Project Snapshots</name> One             <URL>http://192.168.1.103:8081/nexus/content/repositories/snapshots/</URL> A         </snapshotrepository> -     </distributionmanagement>

    Note You also need to configure MVN publishing permissions, or you will report a 401 error, configure permissions in Settings.xml, where the ID is identical to the ID in the pom file

    1 <Server>2     <ID>User-release</ID>3     <username>Admin</username>4     <Password>Admin123</Password>5 </Server>6 <Server>7     <ID>User-snapshots</ID>8     <username>Admin</username>9     <Password>Admin123</Password>Ten </Server>

    After a successful release, you can see it in the Nexus

    

    • Upload a third-party jar package, select the 3rd party-->artifact upload--> Select the Gav mode--fill in the Build parameters--Add jar pack--upload, browse storeage view

"Maven" Nexus Configuration and use

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.