Linux installation configuration Nexus and MAVEN application

Source: Internet
Author: User
Tags wrapper

---------------------Nexus----------------------

1. Edit Nexus Script, configure Run_as_user parameters
Vi/usr/local/src/nexus2/nexus-2.12.0-01/bin/nexus
#NEXUS_HOME = ".." Instead: Nexus_home= "/usr/local/src/nexus2/nexus-2.12.0-01"
#RUN_AS_USER = Change to: run_as_user=root


2. Modify the JDK:
Vi/home/nexus/nexus-2.12.0-01/bin/jsw/conf/wrapper.conf

Wrapper.java.command=/usr/local/src/java/jdk1.7.0_51/bin/java

3. Open port 8081
A)/sbin/iptables-i input-p TCP--dport 8081-j ACCEPT

Save
b)/etc/rc.d/init.d/iptables Save

View Port Open
c)/etc/init.d/iptables Status

4. Start Nexus
/usr/local/src/nexus2/nexus-2.12.0-01/bin/nexus start

5. Set boot start (under/usr/local/src/nexus2/nexus-2.12.0-01/bin path)
CP nexus/etc/rc.d/init.d/

cd/etc/rc.d/init.d/

Chkconfig--add Nexus
Chkconfig--list | grep Nexus
Chkconfig Nexus on
Chkconfig--list | grep Nexus

6. Execute the following command to start and stop the Nexus service
# Service Nexus Start
# Service Nexus Stop


------------------------maven-----------------------

1. Extracting Maven Files
TAR-XVF apache-maven-3.3.9-bin.tar.gz

2. Configuring MAVEN Environment variables
Vim/etc/profile
Export Maven_home=/usr/local/src/maven
Export path= $PATH: $MAVEN _home/bin

3. Make the document effective
Source/etc/profile

4. Test if MAVEN is installed successfully
Mvn-version

5. Configuration and Maven use
A) Linux in the path {maven_home}/conf settings.xml file,
Configure a mirrored warehouse for all warehouses, the address of the mirrored warehouse

b) Windows in the C-drive user. m2 settings.xml file,
Configure a mirrored warehouse for all warehouses, the address of the mirrored warehouse


6. Configure the Local warehouse (settings.xml)
<localRepository>E:\wangfg\repo</localRepository>

7. Configure Nexus maven for private projects

A) settings.xml file
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>

b) Pom File
<!--auto-release artifacts to remote warehouses--
<distributionManagement>
<repository>
<id>nexus</id><!--This ID needs to match the repository ID of your release warehouse--
<url>http://192.168.162.93:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>nexus</id><!--This ID needs to match the repository ID of your snapshots warehouse--
<url>http://192.168.162.93:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<!--configure MAVEN to download components from Nexus--
<repositories>
<repository>
<id>nexus</id>
<name>team Maven repository</name>
<url>http://192.168.162.93:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

8. Configure Universal Nexus Maven (Settings.xml)
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</server>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<url>http://nexus-releases</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<url>http://nexus-releases</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>

Linux installation configuration nexus and Maven applications

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.