Http://mirrors.cnnic.cn/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
- Download the apache-maven-3.0.5-bin.tar.gz package and use the FTP tool to transfer it to the server.
- Unpacking the installation package
- Configuring Environment variables
Vi/etc/profile at the end of the add export maven_home=/usr/local/src/apache-maven-3.0.5export path= $PATH: $MAVEN _home/bin
Source/etc/profile
- Verify that the installation is successful
MVN--version
- Download Nexus: (2.* version)
wget https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/oss/nexus-2.14.8-01-bundle.tar.gz
Admin/admin123
Repositories/releases/configuration/deployment Policy
Allow Redeploy
- Click Repositories to set the Download Remote Indexes in the Configuration of all the items in the list type proxy to True
- Configure local Project References
- Automatically publish artifacts to remote repositories, add in Project Pom.xml
<distributionManagement> <repository> <id>releases</id><!-- This ID needs to match the repository ID of your release repository-- <url>http://192.168.1.11:8081/nexus/content/repositories/ releases</url> </repository> <snapshotRepository> <id>snapshots</id> <!--this ID needs to match the repository ID of your snapshots warehouse-- <url>http://192.168.1.11:8081/nexus/content/ Repositories/snapshots</url> </snapshotRepository></distributionManagement>
- Modify the Settings.xml configuration file in the local $maven_home\conf directory and add the following configuration
<servers> <server> <id>releases</id> <username>admin</username > <password>admin123</password> </server> <server> <id> snapshots</id> <username>admin</username> <password>admin123</password> </server></servers>
Linux installation MVN and Nexus remote repositories