use Nexus to build maven local repository
Read CatalogueOrder Nexus
Order
There may be some development machines in the work can not be Internet access, a large number of machines to obtain jar package will cause the company network is slow, and when the company will release its own version of the project, other projects may rely on the reference, so you need to use MAVEN's local warehouse.
Here's how to build a local maven repository. Nexus One: Introduction
Nexus is Maven's warehouse manager, used to build a local warehouse server, so that the benefits of easy management, save network resources, speed, through the snapshot version control, open the module between the efficient dependency development. Two: Download
We'll get the latest version from Https://www.sonatype.com/download-oss-sonatype. The Nexus-2.12.0-01-bundle.zip is used here. Three: Decompression
After extracting to local directory structure.
We can see Nexus.bat in the bin. By the time we can use this command lai an loading and unloading, start to stop the Nexus service.
Four: Configure environment variables
Because it was developed in Java. So you need to install the JDK, and configure the Java environment variables, this is not the table.
New environment variable Nexus
The value is the extracted directory F:\nexus-2.12.0-01\
Add to the path;%nexus%\bin
Can see
So you can. From the diagram we can see the command: Start,stop and so on. Five: Install the service, start the service
Let's install the service first.
Nexus.bat Install
This will allow installation and prompt installation. We can start the service.
Nexus.bat start
After the prompt is successful we can enter 127.0.0.1:8081/nexus to access.
VI: Use
In the upper right corner there is a log in. Click this to log in. Username is Admin password default is admin123
After logging in, click Repositories on the left Views/repositores
Hosted: A local repository, usually we deploy our own artifacts to this type of warehouse. such as the company's second-party library.
Proxy: The broker repository, which is used to proxy remote public repositories, such as the MAVEN central repository.
Group: Warehouse Group, used to consolidate multiple hosted/proxy warehouses, when your project wants to use resources in multiple repository, it does not need to reference multiple times, just need to refer to a group.
Central: It's Maven's center warehouse, and here's the example.
Select the type of warehouse
Repository Policy is release or snapshot
Download Remote Index file
Click the central repository, then click Configration. Change the download Remote indexes to True to save.
Because the index is relatively large, it will take a while to download.
The routing option can see the status of the current warehouse and the remote warehouse. and set the update frequency.
Put the set up warehouse in the warehouse group.
Click Public repositories->configuration
Put central to the left.
Click Browse Index and we can see a lot of resources in the warehouse.
Configure MAVEN to open the \apache-maven-3.3.3\conf\settings.xml configuration file.
The <mirror> node is configured as follows
<mirrors>
<!--mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that | This mirror serves have an ID, that matches, the
mirrorof element of this mirror. IDs is used
| For inheritance and direct lookup purposes, and must is unique across the set of mirrors.
|-->< c6/><mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<name>human Readable Name for this mirror.</name>
<url>http://127.0.0.0:8081/nexus/content/groups/public/< /url>
</mirror>
</mirrors>
We can use this configuration to the local repository in Elipse.
--------------------------------------------------------------------
Here, the content of this chapter is complete.