Install and configure Maven private server software and basic configuration
Install configurations
# Install JDK, refer to other tutorials mkdir-P/APP/nexus2 # create directory wget https://download.sonatype.com/nexus/oss/nexus-2.14.8-01-bundle.tar.gz# unzip tar-zxvf nexus-2.14.8-01-bundle.tar.gz # modify configuration, add "Export run_as_user = root" Vim/etc/profilesource/etc/profile in the header # Enter the directory CD/APP/nexus2/nexus-2.14.8-01/bin # Start Maven. /nexus start # access http: // 172.16.48.129: 8081/nexus/
Configure folders and paths
/APP/nexus2/nexus-2.14.8-01/Conf
Log folder and Path
/APP/nexus2/nexus-2.14.8-01/logs
Software index Configuration
Index data directory: sonatype-work/nexus/Indexer
- Update the Nexus index. Synchronize the settings.
- Manual Index Update
File preparation required for manual update:
- Nexus-maven-repository-index.gz
Nexus-maven-repository-index.properties
On the official Maven website, you can find: http://repo.maven.apache.org/maven2/.index/
Indexer-cli-5.1.1.jar
Search indexer-CLI on maven site to find the corresponding version: http://search.maven.org/
Update index:
# Prerequisites for installing JDK. You need to use the Java command to decompress indexes. # When performing these operations, it is best to stop the Nexus server ,. /nexus stop to prevent exceptions # create an index compressed package and place the directory mkdir-P/APP/nexus/index # upload the file to the server in the same directory ll # Run the result-RW- r -- 1 Root 6576184 November 1 10:34 indexer-cli-5.1.1.jar-rw-r -- r -- 1 Root 578261578 November 1 10:34 nexus-maven-repository-index.gz-rw-r -- r -- 1 Root 1130 November 1 10:34 nexus-maven-repository-index.properties # decompress the index file, wait for completion, interrupted halfway, please delete the build folder and run the command again Java-jar indexer-cli-5.1.1.jar-u nexus-maven-repository-index.gz-D indexer # Run the result index Folder:/APP/nexus/indexoutput Folder: /APP/nexus/index/indexertotal time: 7 min 7 secfinal memory: 77 m/131 M # decompress all files in/APP/nexus/index/indexer, copy/APP/nexus/sonatype-work/nexus/Indexer/Central-CTX to the index directory Rm-RF/APP/nexus/sonatype-of Indexer in the nexus working directory- work/nexus/Indexer/Central-CTX/* CP-r/APP/nexus/index/Indexer/*/APP/nexus/sonatype-work/nexus/Indexer/Central-CTX # Start nexus ,. /nexus start enters the central repository, refresh all, and configure synchronization with the central repository.
Repository migration settings
The component repository of nexus is saved in the sonatype-work directory, and the directory location is specified by the Nexus/CONF/nexus. properties configuration file.
Two steps are required for warehouse migration: Backup and restoration.
Backup warehouse: Back up the sonatype-work folder as a whole. You can also back up only the two most important folder indexes (Indexer) and storage)
Restore Repository: copy the backed up sonatype-work file to the new server. Modify the configuration file nexus/CONF/nexus. properties and specify the repository directory again.
Jar package Search Optimization
Associate a public repository with all the repositories for easy search, such:
Snapshot version cleanup settings
Add task: http://crabdave.iteye.com/blog/2358012
Official blog: https://blog.sonatype.com/2009/09/nexus-scheduled-tasks/
References:
Set boot start: 76099807
Common configuration: 53585721
FAQs about installation and configuration of nexus private server