Linux installs Maven and Nexus Agent repositories

Source: Internet
Author: User
Tags wrapper sonatype sonatype nexus

    • 1 description
    • 2 Installation Steps
    • 2.1
    • 2.2 Maven Installation Steps
    • 2.2.1 Unpacking the MAVEN installation package
    • 2.2.2 Configuring environment variables
    • 2.3 Sonatype Nexus Installation Steps
1 description

Environment: Redhat Enterprise Linux server5.3-x64.

Version: Maven 3.0.5, Nexus-2.5.1-bundle.

2 Installation Steps 2.1

Maven:

Http://mirrors.cnnic.cn/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz

Nexus:

http://www.sonatype.org/nexus/archived_version?id=38

2.2 Maven Installation Steps 2.2.1 Unpacking the MAVEN installation package

1. Transfer the downloaded apache-maven-3.0.5-bin.tar.gz package to the server using the FTP tool.

2. Unzip the installation package

Decompression command:

?
1 tar-zvxf apache-maven-3.0.5-bin.tar.gz

Move to the/usr/local:

?
1 mvapache-maven-3.0.5 /usr/local

MAVEN is installed under the/usr/local directory.

2.2.2 Configuring environment variables

1. Edit the/etc/profile and add the following at the end:

Edit command:

?
1     vi/etc/profile

Insert: Press I

In the last line join:

?
123     exportMAVEN_HOME=/usr/local/apache-maven-3.0.5     exportPATH=$PATH:$MAVEN_HOME/bin

Press ESC, enter: X to exit the save.

Let the system re-execute the next/etc/profile, command:

?
1     source/etc/profile

2. Verify that the installation is successful

?
1     mvn --version
2.3 Sonatype Nexus Installation Steps

1. Transfer the downloaded nexus-2.5.1-bundle.tar.gz package to the server using the FTP tool.

2. Unzip the installation package

Decompression command:

?
1     tar-zvxf nexus-2.5.1-bundle.tar.gz

Move to the/usr/local:

?
12345     sudocp nexus-2.5-01-bundle.tar.gz /usr/local     cd /usr/local     ls-n nexus-2.5-01 nexus

The Nexus is installed in the /usr/local directory.

You can edit $NEXUS _home/conf/nexus.properties Custom settings parameters, including port numbers, and so on.

Depending on your system platform, you can start the Nexus and start the command:

?
1 ./nexusstart
(if you are logged in with the root account, you need to set up run_as_user=root, you can also add a Nexus user to manage the Nexus specifically, you need to note that this account has access to the Nexus)

2. Set up the Nexus for Linux system service and boot automatically

1. Copy $nexus_home/bin/jsw/linux-x86-64/nexus to/etc/init.d/nexus

2. Grant the Nexus script permission to execute:

?
1     chmod755 /etc/init.d/nexus

3. Modify the Nexus file to configure the following parameters:

A) Modify the Nexus_home absolute path, such as: Nexus_home= "/usr/local/nexus"

b) Set Run_as_user=nexus, or all other users, provided that this user is created.

?
1234567891011         NEXUS_HOME=/usr/local/nexus         PLATFORM=linux-x86-64        PLATFORM_DIR="${NEXUS_HOME}/bin/jsw/${PLATFORM}"        WRAPPER_CMD="${PLATFORM_DIR}/wrapper"        WRAPPER_CONF="${PLATFORM_DIR}/../conf/wrapper.conf"         PIDDIR="${NEXUS_HOME}"

4. Red Hat, Fedora, CentOS add Nexus Service:

?
123456789      cd /etc/init .d        chkconfig--add Nexus        chkconfig--levels 345 nexus on       service Nexus start       tail -f /usr/local/nexus/logs/wrapper .log

Ubuntu and Debian add Nexus Service

?
123456789      cd /etc/init .d        update-rc.d Nexus defaults        chkconfig--levels 345 nexus on       service Nexus start       tail -f /usr/local/nexus/logs/wrapper .log

After the configuration is complete, you can access: Http://localhost:8081/nexus (localhost for your server address), enter the system to set up

Default Admin Account: admin Password: admin123

You can manage your warehouse when you enter.

Linux installs Maven and Nexus Agent repositories

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.