Nexus repository configuration


1, Nexus called the Nexus Repository OSS. Nexus repository into Version 2.x and 3.x versions. Because 2.x is relatively stable, so we're using 2.x version.
2, Nexus Download to https://www.sonatype.com/download-oss-sonatype. CentOS can be downloaded by wget https://www.sonatype.com/download-oss-sonatype. Directly unzip the download is complete you can use.
3, after the extraction is completed, the folder name is "nexus", there are two executable files, nexus and nexus.bat files nexus / bin directory. Nexus.bat used to start the windows system. In centOS can start by nexus start system, nexus stop stop system. Note: Before using this command to configure the environment variable RUN_AS_USER = username. I use here the root user, and therefore needs to be configured to export RUN_AS_USER = root in / etc / profile file.
4, after the start nexus, nexus directory will automatically create a folder sonatype-work. Sonatype-work directory stores all jar files in the current PW have. When we need to download a jar file that is downloaded from this directory.
5, Nexus system default user name and password is admin / admin123. By the username and password login system. Select Repositories option, the system default repository seven, three types. Host Repositories local repository, we own the uploaded file; Proxy Repositories proxy repository, files for download on the remote repository to local, form a local library. Virtual Repositories virtual repository. First select Central proxy repository in Download Remote Indexes Configuration tab will be set to true. Open the downloaded function. Then right-click Central Library. Select Update Index file repository synchronization, remote resources synchronized to the local.
6, Releases select Options, select Deployment Policy is set to Allow Redeploy in the tab. So that when we repeat themselves upload files without error.
7, see the Administrator through the Scheduled Tasks function of whether the task synchronization is complete. Logging view the log information.
8, the Nexus After the configuration, provided Maven. In Maven's setting.xml file, add Server, mirror configuration. Server for which maven automatically deployed to the nexus library, mirror resource maven repository by downloading relevant.
<Servers>
<Server>
<the above mentioned id> uniquely identifies </ the above mentioned id>
<username> Login nexus of </ username>
<password> Login password information for the Nexus </ password>
</ Server>
<

<Mirror>
<the above mentioned id> uniquely identifies </ the above mentioned id>
<mirrorOf> Central (which resource library downloaded via) </ mirrorOf>
<url> http://192.168.99.152/nexus/content/repositories/central (Download) < / URL>
</ Mirror>
</ Mirrors>

. 9, after the completion of MAVEN configuration. Add the following configuration in the pom.xml file in the project. Id id servier wherein the configuration file for the maven setting.xml, the two must correspond ID. url is the path to upload files.
<distributionManagement>
<Repository>
<ID> Releases </ ID>
<URL> http://192.168.99.152/nexus/content/repositories/releases/ </ URL>
</ Repository>
</ distributionManagement>
After the configuration, execute deploy command to deploy the package to the jar on the PW.

Guess you like

Origin blog.csdn.net/tianlong1569/article/details/82856457