Detailed introduction and installation of "project management and Construction" Nexus (IV)

Source: Internet
Author: User
Tags sonatype

In the previous few posts, we described how to use Maven, this post we simply introduced the MAVEN nexus.


Brief introduction


Nexus is the MAVEN repository manager or maven. Nexus is a powerful MAVEN warehouse manager that greatly simplifies the maintenance of its internal warehouses and access to external warehouses. With Nexus you can have full control over every artifact in your maintained warehouse in just one place. Nexus is a set of "out-of-the-box" systems that do not require a database, which organizes data using the file system plus lucene.

Nexus is not the core concept of Maven, it is just a derived special maven repository. For Maven, there are only two types of warehouses: local warehouses and remote warehouses.


The local repository is the local warehouse address that we configured in Maven's setting.xml. Since the original local repository is empty, Maven must know at least one of the available remote warehouses to download to the required artifacts when executing the MAVEN command.

The central repository is the MAVEN default remote repository.   

A special remote repository, which is built on a local area network, is to broker remote warehouses and deploy third-party components. When Maven needs to download the widget, it can be downloaded to the local repository if it is available, otherwise the remote repository will be requested to download the widget to the local repository.


Why use Nexus?

1, save the external network bandwidth.

A large number of repeated requests for external warehouses will consume bandwidth, and the external warehouse can eliminate redundant component downloads and reduce the pressure on bandwidth.

2. Accelerate maven build.

It's time-consuming to connect to requests for an external repository, and Maven keeps checking the data at the remote repository as it executes the build. Maven only checks local area network data to improve the speed of construction.

3. Deploy third-party components.

When a component cannot be obtained from any external remote repository. Once established, these artifacts can be deployed to the internal MAVEN project.

4, improve stability, enhance control.

MAVEN builds are highly dependent on remote warehouses, so when the network is unstable, MAVEN builds can become unstable or even impossible to build. A large number of builds are cached, and Maven can run properly even if there is no network at the moment.

5, reduce the load of the central warehouse.

The use of a large number of central warehouses can avoid repeated downloads, reduce the pressure of the central warehouse.



Install Nexus

Nexus Pro is required for payment and we use the open source Nexus OSS. The Nexus provides two mounting options, one embedded jetty bundle, which can be run directly if you have a JRE. The second is a war package that does not contain a container, and you simply publish it to a Web container to use.


Nexus Downloads:
        : Http://www.sonatype.org/nexus/go, download the latest version of Nexus, I'm using Nexus-2.8.1-bundle.

Bundle Mode Installation:


1, extract Nexus-2.8.1-bundle.zip to any directory, such as: D:\tools\maven. This is going to get the following two directories:



1.1. NEXUS-2.8.1-01: This directory contains the files required for the Nexus to run, such as startup scripts, dependent jar packages, and so on.

Open Directory \NEXUS-2.8.1-01\BIN\JSW This directory you will find there are many system versions of the Nexus environment, such as:

My Computer is a Windows system, I open a folder, folder contains a Nexus command, such as:

1.2, Sonatype-work: This directory contains the nexus generated configuration files, log files, warehouse files. The directory is not required, the Nexus will be created dynamically at runtime, no longer too much to introduce.


2. To facilitate startup and exit of the Nexus, add the bin to the environment variable.




3. Use the command Nexus install to mount the Nexus to Windows services.



Nexus start successfully, then open the browser, Access Http://localhost:8081/nexus , you will see the following page:



to stop Nexus , Ctrl + C You can also use the Stop command .


War mode installation:


you need to have a runningWebApp'scontainer, here withTomcatas an example, joinTomcatThe installation directory is located inD:\tools\apache-tomcat-6.0.18 , First we will download theNexus-webapp-1.3.0.war Rename toNexus.war , and then copy toD:\tools\apache-tomcat-6.0.18\webapps\nexus.war , and then startCMD,CDto theD:\tools\apache-tomcat-6.0.18\bin\ directory, runningStartup.bat . EverythingOK, you can now open a browser to accessHttp://127.0.0.1:8080/nexus, and you will get the same interface.



Login

In the upper right corner, click Log in, use Username: admin, Password: admin123 login, you can use more features.



Summarize:

Nexus Introduction and installation, very simple, if there is a problem can leave a message. In the next post we'll cover the Nexus Warehouse and warehouse group in detail.



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

"Project management and Build" Nexus details and installation (iv)

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.