Set up a maven repository under centos6.5

Source: Internet
Author: User

Set up a maven repository under centos6.5
System Environment: CentOS-6.5 installation instructions

Installation Method: Compressed package

Attach my own installation package address:

Link: http://pan.baidu.com/s/1c0ucQuG password: 3ssh

Compressed package: apache-maven-3.3.3-bin.tar.gz,nexus-2.11.1-01-bundle.tar.gz

1. Install the java environment first. skip this step if it is already installed.

[Root @ localhost opt] # yum list installed | grep java

[Root @ localhost opt] # yum-y remove java-1.7.0-openjdk *

[Root @ localhost opt] # yum-y remove tzdata-java.noarch

First, check whether the java environment package is installed, and then uninstall and reinstall it.

[Root @ localhost opt] # yum-y list java *

[Root @ localhost opt] # yum-y install java-1.7.0-openjdk * ==> start Installation

[Root @ localhost opt] # java-version ==> check whether the installation is complete
Java version "1.7.0 _ 85"
OpenJDK Runtime Environment (rhel-2.6.1.3.el6_7-x86_64 u85-b01)
OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode)

2.download apache-maven-3.3.3-bin.tar.gz,nexus-2.11.1-01-bundle.tar.gz

[Root @ localhost opt] # cd/opt/

[Root @ localhost opt] # ls
Apache-maven-3.3.3-bin.tar.gz nexus-2.11.1-01-bundle.tar.gz

[Root @ localhost opt] # tar zxvf apache-maven-3.3.3-bin.tar.gz

[Root @ localhost opt] # tar zxvf nexus-2.11.1-01-bundle.tar.gz

3. Configure environment variables and edit the/etc/profile file,

[Root @ localhost opt] # vi/etc/profile

Add the following code:

MAVEN_HOME =/opt/apache-maven-3.3.3
Export MAVEN_HOME
Export PATH =$ {PATH }:$ {MAVEN_HOME}/bin

4. Verify that the maven installation configuration is successful. Load the environment variable configuration first. Run the maven command to view the version information. If the check succeeds, the maven installation is successful, and you only need to build a maven repository.

[Root @ localhost ~] # Source/etc/profile ==> update after adding

[Root @ localhost ~] # Mvn-v ==> installation successful
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T07: 57: 37-04:00)
Maven home:/opt/apache-maven-3.3.3
Java version: 1.7.0 _ 85, vendor: Oracle Corporation
Java home:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431. el6.x86 _ 64", arch: "amd64", family: "unix"

5. Start nexus

[Root @ localhost bin] # cd/opt/nexus-2.11.1-01/bin/==> go to the/opt/nexus-2.11.1-01/bin/directory

[Root @ localhost bin] # vi nexus ==> modify the configuration

Find # RUN_AS_USER =, remove #, and add your account root.

[Root @ localhost bin] #./nexus start
****************************************
WARNING-NOT RECOMMENDED TO RUN AS ROOT
****************************************
Starting Nexus OSS...
Started Nexus OSS.

Service iptables stop ==> stop Firewall

6. Enable the nexus configuration.

Open your browser and enter http: // host_address: 8081/nexus. Default username/password: admin/admin123

If you have enabled the firewall, configure it. I have disabled it.

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.