Deploy MAVEN Nexus and manual Sync Central Warehouse index under Linux system

Source: Internet
Author: User
Tags create directory sonatype

First, the preparatory work

1, download jdk and maven nexus,jdk very good download, not much to explain, but Maven nexus at that time I can not download from the official web, on the internet for a long time, and finally from the CSDN shared files downloaded to, to share it to the network to provide easy download. (Note: JDK version will match maven version)

Nexus's Web Drive content:

Link: Http://pan.baidu.com/s/1qWsYScG Password: 8hb0-----This version is 2.4

Link: http://pan.baidu.com/s/1ntEJExb Password: 1LSW------This version is 2.10

2, manually add indexes need to download index files, a total of three files:

Nexus-maven-repository-index.properties

Indexer-cli-5.1.0.jar

Nexus-maven-repository-index.gz

These three files are:

http://repo.maven.apache.org/maven2/.index/

Friendly tip: Download the latest version of the file, after the time of the update has been written.

3, prepare a Linux system machine or virtual machine, install Lrzsz in the virtual machine, easy to transfer files to Linux

Ii. Installation of JDK

1, use the following command will query the machine whether there is already a JDK, so that the Linux system will be built into the JDK, generally do not use, directly uninstall.

Querying the JDK under the Linux system:

Rpm-qa | grep java

To delete a JDK command:

RPM-E--nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64

RPM-E--nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64

Note: This command cannot be copied directly, because different systems have different versions of the JDK, and the content behind the rpm-e–nodeps is Rpm-qa | grep java Command Query to the JDK is the standard, if not queried, nature will not have to uninstall.

2, install the JDK, follow the steps in sequence

A) Create directory: Mkdir–p Usr/local/src/java

b) Enter the directory established in the previous step: cd/usr/local/src/java/

c) Upload the JDK compressed file: RZ command

D) Unzip the JDK package: TAR–CVF jdk-7u75-linux-x64.tar.gz (JDK version does not have to be the same)

e) Configure the JDK environment variable: vim/etc/profile, at the end of the open file, add a section configured as follows:

Java_home=/usr/local/src/java/jdk1.7.0_75

Classpath=.: $JAVA _home/lib.tools.jar

Path= $JAVA _home/bin: $PATH

Export Java_home CLASSPATH PATH

f) Enable this configuration now: Source/etc/profile

g) Enter Java command test in any directory, JDK installation complete

Third, install Nexus

1. Create User: Useradd Ucenter–d/ucenter

2. Set password for User: passwd ucenter

3. Using root user, create directory in Ucenter: mkdir Maven-nexus

4. Enter the directory you created in the previous step: CD Maven-nexus

5. Upload the Nexus file to the directory and use the RZ command to unzip it, then use the following command:

TAR–CVF nexus-2.10.0-02-bundle.tar.gz

After decompression there will be two file directories:

nexus-2.10.0-02

Sonatype-work

6, this time can enter the Nexus-2.10.0-02/bin under, using the./nexus Start command to run the Nexus, you can enter http://192.168.56.102:8081/nexus/access in the host machine ( Virtual machine I use host-only and host interaction), but at this time access to the server does not have an index, no rack-dependency, at this time is not very friendly, after a period of online search, installation index There are two ways, one is online installation, one is manual installation, online installation because it is connected to the outside network is very slow, Sometimes not sure to succeed, once in this blog post I will no longer specify the online installation index, interested in online search, this aspect of a lot of things, here I will specifically say a manual installation index.

Note: The nexus cannot be started with root, it will be wrong, you need to use the root user to authorize the MAVEN directory to Ucenter, first use the root directory into the Maven directory, execute the following command:

Chown–r Ucenter:ucenter./

After the command execution is over, switch to the Ucenter user, enter the Nexus-2.10.0-02/bin directory, and run the Nexus using the./nexus Start command.

Iv. Installation Index

1, switch to/sonatype-work/nexus/indexer/central-ctx directory, upload ready to work the second step to download the three files to the directory, using the RZ command to complete the upload.

2, upload completed, three files in the same directory, execute the following command:

Java-jar indexer-cli-5.1.0.jar-u nexus-maven-repository-index.gz-d.

It takes about 4 minutes for the command to execute, please be patient

3, after the execution of the command, delete the uploaded three files, re-enter the Nexus-2.10.0-02/bin directory, using the./nexus Start command to run the Nexus.

4, at this time in the external access will implement the search for the index.

Deploying MAVEN Nexus and manually synchronizing the Central Warehouse index under Linux systems

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.