Building a Nexus

Source: Internet
Author: User
Tags sonatype

First, installation

1. Download Nexus software from the Internet
Https://www.sonatype.com/download-oss-sonatype Download Nexus Repository Manager OSS Package
Currently I am using the 3.0 version, below is the version bit example of installing 3.0
2, will download the nexus-3.13.0-01-win64.zip extracted to the target path, the official website recommends that Windows do not put under Program files, then I placed under the D:/develop
3.
(1) Not registered as a system service, directly run:
A) Enter the bin directory and run the cmd command: Nexus.exe/run run the private repository at this time; Linux version can be executed: nexus/run
b) Press Ctrl-c to stop the operation;
(2) registering as a system service (to ensure that the JDK has been installed in the system):
A) Enter the bin directory and run Cmd:nexus.exe/install to install the private repository at this time;
b) After the installation is complete, the default access port is not 8081, the context is/
c) After entering the page, login directly, account: admin admin123
d) Please use IP access when visiting

4. For more information about Nexus Repository Manager, refer to the website: https://help.sonatype.com

Second, the configuration

After the above method is set up, it is necessary to configure the contents of the http://127.0.0.1:8001/to access the user Universal browser.

1. Log in as Administrator

In the top right corner of the homepage, click "Signin" to enter the login page, the account number is: admin password: admin123;

2, configure the Agent warehouse

Local maven (installed MAVEN software) in the absence of a setting.xml, you need to configure a variety of proxies or mirrors (these will be downloaded to the local repository by the required third-party-provided jar packages for direct reference by the MAVEN project). However, due to the speed of the network or in different computer projects need to connect the Internet through the mirror to download the required jar, on the one hand, slow, on the other hand bad management. Therefore, it is necessary to have the Setting.xml directly configure the warehouse address.

(1) Configure a variety of common warehouse address (Add new agent source)

    • Set name and URL

Cache unified set to 200 days 288000

    • Increase the number of agents you use
1. Aliyunhttp://Maven.aliyun.com/nexus/content/groups/public2. Apache_snapshothttps://repository.apache.org/content/repositories/snapshots/3. Apache_releasehttps://repository.apache.org/content/repositories/releases/4. Atlassianhttps://maven.atlassian.com/content/repositories/atlassian-public/5. Central.maven.orghttp://central.maven.org/maven2/6. Datanucleushttp://Www.datanucleus.org/downloads/maven27. maven-Central (after installation, only need to set cache expiration) https://repo1.maven.org/maven2/8. Nexus.axiomalaska.comhttp://Nexus.axiomalaska.com/nexus/content/repositories/public9. Oss.sonatype.orghttps://Oss.sonatype.org/content/repositories/snapshots10. Pentahohttps://public.nexus.pentaho.org/content/groups/omni/spring-.Snapshotshttps://Repo.spring.io/snapshot//When configuring this proxy source, Version Pollcy to be set to Snapshot,layout Pollcy to be set to Permissive.spring-.Milestoneshttps://Repo.spring.io/milestone

Again, in

How long (in minutes) to cache metadata before rechecking the remote repository.

Unified set to

288000 that's 200 days, of course, can be set to a longer time

Set Maven-public

    • Join these agents to group

    • To set up a private warehouse for recurring publishing

Nexus installation comes with maven-releases,maven-snapshots two warehouses, which are used to publish the generated jar packages in both warehouses, and in real-world development you need to set maven-releases to be repeatable.

Maven-releases

  

Note: Maven-snapshots can be redeployed by default.

(2) Under MAVEN installation path, configure the following conf/setting.xml:

<settings> <pluginGroups> <pluginGroup>org.sonatype.plugins</pluginGroup> </plugingro ups> <mirrors> <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> & Lt;url>http://localhost:8081/repository/maven-public/</url></mirror> </mirrors> <profiles> <profile> <id>nexus</id> <!--Enable Snapshots forThe built repo to direct-to-<!--all requests to nexus via the mirror-to-&LT;REPOSITORIES&G        T <repository> <id>central</id> <url>http://central</url><releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://central</url><releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <!--make the profiles active all the time-<activeprofile>ne      xus</activeprofile> </activeProfiles> <servers> <server> <id>nexus</id> <username>admin</username> <password>admin123</password> </server> </servers&gt ;</settings>

(3) test

Remove all previously downloaded jar packages from the Maven warehouse address recorded in Settings.xml. In the MAVEN project right-click Maven---> Update product, in the pop-up box, select "Force update of Snapshorts/releases" and re-download the jar package you want to rely on.

PS: The contents of the configuration reference: https://www.cnblogs.com/fanzhenyong/p/7709434.html

Building a Nexus

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.