Table of contents
- I. Introduction
- 2. Create Blob Stores
-
- 1. Before creating the Repository, set a file storage directory Blob to facilitate subsequent management
- 2. Select the Blob type to be created as File, and select whether to alarm when the constraint is exceeded, as well as the constraint type and constraint limit
- 3. Successfully created a good page
- 3. Create a Repository (resource library)
I. Introduction
Nexus has been installed and can be successfully logged in
2. Create Blob Stores
1. Before creating the Repository, set a file storage directory Blob to facilitate subsequent management
2. Select the Blob type to be created as File, and select whether to alarm when the constraint is exceeded, as well as the constraint type and constraint limit
3. Successfully created a good page
3. Create a Repository (resource library)
Nexus's resource library mainly has three kinds of resource libraries, Proxy Repository (proxy resource library), Hosted Repository (managed resource library), Repository Group (group resource library) proxy resource library: is a repository linked
to a remote repository. Any request for a component (which can be understood as a jar package) will be verified against the local content of the proxy repository. If no local component is found, the request is forwarded to the remote repository. The components are then retrieved and stored locally in the repository manager, which acts as a cache.
Managed repository: is a repository that stores components in a repository manager as the authoritative location for those components. It is understood that it is placed in the local resource library, and the jar package we uploaded is placed in this resource library.
Group Repositories: These allow combining multiple repositories and other groups of repositories in a single repository. It is understood as agent library + managed library, the jar package is not stored in the group library, and the agent library and managed library are actually stored in the jar package.
1. Create a Proxy Repository
①. Enter the resource library creation interface
②, find maven2 (proxy)
③. Fill in the proxy resource library configuration, other configurations do not need to be changed
Aliyun's maven central warehouse address: http://maven.aliyun.com/nexus/content/groups/public/
④, finally click Create repository to complete the creation
2. Create a Hosted Repository
We need to create two Hosted Repositories, one of type Release and one of type Snapshot.
The release type warehouse is mainly used to store the jar packages we released;
the snapshot type warehouse is mainly used to store the jar packages we developed, and is a frequently updated repository
①. Enter the creation interface and select maven2 (hosted)
②. Fill in the configuration information
③. Finally, click Create repository to complete the creation
④, Follow the steps just now to create a managed resource library of type Snapshot
⑤. Two managed resource libraries have been created
3. Create a group resource library
①, select maven2 (group)
②. Configure the resource library
Why pay attention to the order?
It is suggested in the official document that
the order of hosted repositories should be placed before proxy repositories, because a group can include these hosted repositories and proxy repositories. And a whole group is used as a public, an interface for others to use. So when looking for the shelf package, if the agent resource library is in front, it is to find the jar from the remote first, instead of first looking for the jar from the managed resource library (local warehouse). In this way, the consumption of accessing the external network is compared to searching locally. Of course, the managed resource library is placed in the priority position before the proxy resource library.