- Why do you want to set up?
In the development process, some of the development packages within the company are sometimes used, and it is obvious that it is inappropriate to put these packages externally. In addition, these internal dependencies may be constantly being updated as projects are being developed. By setting up a MAVEN server within the company, the third party and internal dependencies can be managed uniformly, while the network bandwidth can be saved as long as the artifacts required for the project already exist.
- Nexus Download and installation configuration
We can find out about it on the Nexus's official website: http://www.sonatype.org/nexus/go
Download
# wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.11.2-03-bundle.tar.gz
Unzip
# cd/usr/local
# mkdir Nexus
# TAR-XZVF Nexus-2.11.2-03-bundle.tar.gz-c Nexus
# CD Nexus
# ls
nexus-2.11.2-03 Sonatype-work
Modifying a configuration file
# CD Nexus-2.11.2-03/conf
# VI Nexus.properties
#Jetty section
application-port=8081 # #修改Jetty端口号
# Nexus section
nexus-work=${bundlebasedir}/ .. /sonatype-work/nexus
Save the above changes
Configure users
# Vi/usr/local/nexus/nexus-2.11.2-03/bin/nexus
#RUN_AS_USER =
Run_as_user=root
Save the above changes
If you have a firewall set up, go to modify firewall configuration and restart the firewall, skip here ...
-
start Nexus
#/usr/local/nexus/nexus-2.11.2-03/bin/nexus start
****************************************
warning-not RECOMMENDED to RUN as ROOT
****************************************
Span style= "color: #00ccff;" >starting Nexus OSS ...
started Nexus OSS.
Open in browser: Http://ip:8081/nexus, Login: Username admin Default password: admin123
 
- Modify the Maven warehouse address in the project
This completes the configuration. When a MAVEN project is built, the required artifacts are downloaded directly from the network, and if the required artifacts are not available, they are downloaded to the Web before being downloaded locally. Speaking of which, the small partners should all understand the benefits of building a maven! It's necessary ...!!!
Use Nexus to build a maven