Installation and configuration of Maven private libraries and local libraries Sonatype Nexus + Maven

Source: Internet
Author: User
Tags sonatype sonatype nexus

Environment: CentOS 6.6 Final, JDK7, Sonatypenexus , Maven

ip:192.168.4.221

Root User Actions

Prerequisite: The JDK7 is installed and the environment variable is configured

1 , download the latest version of Nexus (This tutorial uses: nexus-2.11.2-03-bundle.tar.gz),: http://www.sonatype.org/nexus/go/

# wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/ nexus-2.11.2-03-bundle.tar.gz

2 , decompression

# Mkdirnexus

# TAR-ZXVF nexus-2.11.2-03-bundle.tar.gz-c Nexus

# Cdnexus

# LS

nexus-2.11.2-03 Sonatype-work

( A Nexus service, a private library directory)

3 , edit Nexus nexus.properties file, configure port and work directory information (leave default)

# cdnexus-2.11.2-03

# LS

Bin conf lib LICENSE.txt logs Nexus NOTICE.txt tmp

View directory structure, jetty run

# cdconf

# Vinexus.properties

# jettysection

application-port= 8081

application-host=0.0.0.0

Nexus-webapp=${bundlebasedir}/nexus

Nexus-webapp-context-path=/nexus

# nexussection

Nexus-work=${bundlebasedir} /.. /sonatype-work/nexus

Runtime=${bundlebasedir}/nexus/web-inf

  

4 , edit Nexus Script, configure Run_as_user parameters

# Vi/root/nexus/nexus-2.11.2-03/bin/nexus

#RUN_AS_USER =

Switch

Run_as_user=root

5 , open port 8081 in the firewall

# Vi/etc/sysconfig/iptables

Add to:

-A input-mstate--state new-m tcp-p tcp--dport 8081-j ACCEPT

Restart firewall after saving

# Serviceiptables Restart

6 , start Nexus

# /root/nexus/nexus-2.11.2-03/bin/nexusstart

****************************************

Warning-not RECOMMENDED to RUN as ROOT

****************************************

Startingnexus OSS ...

Started Nexusoss.

  

7 , open in Browser: http://192.168.4.221:8081/nexus/

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/81/FC/wKiom1dGqwKyLZ7sAAFo5yu2U1c239.png "title=" Maven1.png "alt=" Wkiom1dgqwkylz7saafo5yu2u1c239.png "/>

8 , login, Default user name admin, default password admin123:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/81/FC/wKiom1dGqz3jRuX5AAFr0_4XFS4428.png "title=" Maven2.png "alt=" Wkiom1dgqz3jrux5aafr0_4xfs4428.png "/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/81/FA/wKioL1dGrFKApk18AAEU0DdfqPU964.png "title=" Maven3.png "alt=" Wkiol1dgrfkapk18aaeu0ddfqpu964.png "/>

The Nexus is now complete and the Nexus configuration


Nexus configuration (after login)

1 , Menu Administration/server Configure the Mailbox service address (if you forgot your password, you can retrieve the password via the mailbox)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/81/FC/wKiom1dGq4-QmmtxAAGWENA4OcI825.png "title=" Maven4.png "alt=" Wkiom1dgq4-qmmtxaagwena4oci825.png "/>

To configure the user email address, easy to forget the password back:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/81/FC/wKiom1dGq7Dj3qPyAAG4Ok8NO_E250.png "title=" Maven5.png "alt=" Wkiom1dgq7dj3qpyaag4ok8no_e250.png "/>

User Change Password

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/81/FA/wKioL1dGrMLxK6b5AAE5w4Pw7H8847.png "title=" Maven6.png "alt=" Wkiol1dgrmlxk6b5aae5w4pw7h8847.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/81/FA/wKioL1dGrNqQv_D3AAA07YKj6y0812.png "title=" Maven7.png "alt=" Wkiol1dgrnqqv_d3aaa07ykj6y0812.png "/>

2 , Warehouse type

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/81/FA/wKioL1dGrO7xALGdAAIuYmrcSM0158.png "title=" Maven8.png "alt=" Wkiol1dgro7xalgdaaiuymrcsm0158.png "/>

group Warehouse Group: nexus Unified management of multiple warehouses through the concept of warehouse groups This allows us to request the Warehouse group directly in the project to request multiple warehouses managed by the Warehouse group;

hosted host warehouse: mainly used to publish internal project widget or third-party project artifacts (such as purchases of commercial artifacts) and artifacts that cannot be obtained from public warehouses (such as Oracle JDBC driver)

Proxy Agent Warehouse: acting as a public remote repository;

Virtual Virtual Warehouses: for use with Maven 1;

The general type of warehouse used is hosted, proxy

Hosted Description of common types of warehouses:

releases Release repository for the release module in the internal module

Snapshots Publish the warehouse of the internal snapshot module

3rdparty third-party dependent warehouses, which are usually published by internal personnel after they are downloaded by themselves

If the built MAVEN project local repository does not have a corresponding dependency package, it will go to the Nexus to download,

If the Nexus does not have this dependency package, go back to the Remote central repository download dependency, these central warehouses are proxy. The Nexus download is successfully downloaded to the local MAVEN library for project reference.

3 , set proxy agent repository (Apache Snapshots/central/codehaus snapshots) to allow remote downloads, such as:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/81/FA/wKioL1dGrQ6wiqVeAALlRNF-aOE835.png "title=" Maven9.png "alt=" Wkiol1dgrq6wiqveaallrnf-aoe835.png "/>

4 , MAVEN local library installation and configuration (see the operation of the reference video)

Environment variables, setting.xml

5 , maven configuration in MyEclipse (see the operation of the reference video)

6 , project Build and release demo (see the operation of the reference video)

Modify the private library address in Pom.xml in Common-parent

7 , upload third-party package operation Demo


This article is from the "11642765" blog, please be sure to keep this source http://11652765.blog.51cto.com/11642765/1783504

Installation and configuration of Maven private libraries and local libraries Sonatype Nexus + Maven

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.