maven-use Nexus to create a

Source: Internet
Author: User
Tags nexus hosting artifactory maven central sonatype sonatype nexus

10.1 Introduction


by building your own network, you can reduce the load on the central warehouse, save bandwidth and accelerate Maven build. Deploy components yourself, and so efficiently use Maven.

There are three specialized MAVEN warehouse management software that can be used to help build a dedicated, efficient use of MAVEN.
The Apache Foundation's Archiva, Jforg's Artifactory and Sonatype Nexus. Among them, Archiva is open source, and the core of Artifactory and Nexus is open source.

10.2 Installing the Nexus


Nexus is a typical Java Web application that has two installation packages, a bundle package containing the jetty container, and a war package that does not contain a Web container.


10.2.1 Download Nexus
Download the latest version of Nexus from http://www.sonatype.org/nexus/downloads/, download bundle tar.gz and zip as needed, or war pack


10.2.2 Bundle way to install Nexus

10.2.3 War mode install Nexus

In addition to Bundle,nexus, a war package that can be deployed directly to the Web container is also available. The war package supports mainstream web containers such as Tomcat, Classfish, Jetty, and Resin.
Drop the war packet directly under Tomcat's Wabapps, and then you can access it after the boot. Http://localhost:8080/nexus/will be able to see the Nexus interface.


10.2.4 Login Nexus
The Nexus has full access control, the default Nexus access is anonymous, and the anonymous user only contains some of the most basic permissions, to fully learn and manage the nexus, you must log in as an administrator, the default administrator username and password is admin/admin123.




10.3 Nexus Warehouse and warehouse group
as a MAVEN repository service software, the warehouse is naturally the most important concept in the Nexus. The nexus includes various types of warehouse concepts, including agent warehouses, host warehouses, and warehouse groups. Each warehouse provides rich and useful configuration parameters to make it easy for users to customize as needed .


10.3.1 Nexus built-in warehouse

, this list already contains all types of nexus warehouses. There are four types of warehouses that you can see:

Group (warehouse groups), hosted (host), Proxy (proxy), and virtual. The format for each warehouse is Maven2 or MAVEN1. In addition, the warehouse has a property of policy, which indicates whether the warehouse is a release or snapshot (Snapshot) version of the warehouse. The values for the last two columns are the state of the warehouse and the road strength.
The following describes the use of the various warehouses, here does not introduce MAVEN1 content. Because the role of the virtual column type warehouse is actually to convert the warehouse content format dynamically, in other words, it is also to serve the MAVEN1 format, so it is omitted.




Maven Central: The warehouse agent Mavne the centralized repository with the policy release, so only the release builds in the central repository are downloaded and cached. (Note: now called Central)

Releases: This is a host-type warehouse where the policy is release, which is used to deploy snapshot version artifacts within the organization.

3rd party: This is a host-type warehouse with policy release, which is used to deploy components that cannot be obtained from a public warehouse.

Apache Snapshots: This is a Snapshot Agent repository that is used to proxy the snapshot version artifacts of the Apache Maven repository.


Codehaus Snapshots: This is a broker repository with policy snapshot that is used to proxy the snapshot version artifacts for Codehaus maven repositories.


Google Code: This is a Snapshot Agent repository that is used to represent the release build widget of the Google code maven repository.

Java.net-maven2: This is a Snapshot Agent repository that is used to proxy the release build artifacts of the java.net maven repository.

Public repositories: The Warehouse group aggregates all the above-mentioned policies as release warehouses and provides services through a consistent address.

Public Snapshot repositories: The warehouse aggregates all of the above policies into Snapshot warehouses and provides services through a consistent address.




10.3.2 Nexus Warehouse Classification Concept



, maven can download the widget directly from the host repository, Mavne can also download artifacts from the agent repository, and the agent repository will indirectly download and cache the artifacts from the remote repository; For convenience, maven can download artifacts from the Warehouse group, and the Warehouse group has no actual content (shown in tints in the figure). It will move to the other contained host repository or to the agent repository to get the content of the actual artifact.


10.3.3 Creating a Nexus Hosting Warehouse




10.3.4 creating Nexus Agent Repositories



10.3.5 Creating a Nexus Warehouse Group






The ID, name, and other information in the configuration is the same as above, no longer mentioned here. It is important to note that the Warehouse group does not have the difference between release and snapshot, which is different from the host warehouse and the agent repository. In the configuration interface, users can select the warehouses in the Nexus very intuitively and aggregate them into a virtual warehouse group. Note that the order of the warehouses that the warehouse group contains determines the order in which the warehouse groups traverse the warehouses they contain, so it is best to put the usual warehouses in front of them, and when the user downloads the artifacts from the Warehouse group, they can access the warehouse containing the artifacts as quickly as possible.

maven-use Nexus to create a

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.