How to build your own Maven remote private warehouse

1. First, configure the necessary environments such as Maven, jdk, etc.

2. After configuring the environment, download the latest version of nexus

Download address: http://www.sonatype.org/nexus/go 

3. Open the directory nexus-***\bin\jsw

Under this folder, there are nexus service configuration tools suitable for various platforms.

You can choose the corresponding version according to your own needs, I use the windows-x86-64 version.

Open a Windows version and you will see the following files:

If you want to install nexus as a windows service, click the install-nexus.bat file. After the installation is complete, open the browser and visit http://localhost:8081/nexus/. After startup, the following page is displayed, and there is a Log in in the upper right corner. hyperlink, click to log in

The default username is admin and the password is admin123

After logging in, you can modify the login information on the left:

Next, enter the topic, the warehouse configuration is in the Repositories on the left


 

After clicking, you will see all the warehouse types provided by nexus. The three main ones are 3rd party, Snapshots, and Releases, which are used as third-party warehouses, project snapshot warehouses and project release warehouses.

Here we take the 3rd party warehouse as an example to show you how to upload the jar package. The method is very simple. After selecting the 3rd party warehouse, select Artifact

Upload tab, fill in the groupID, ArtifactID, Version and other information of the package to be uploaded, and then click the upload button below to upload the jar package.

After uploading, you can view the upload results in Browse Index

After completing the upload operation, during our local build process, open the pom.xml file in the Maven project, configure the information in the repository tag to the information of this remote private warehouse, and fill in the corresponding dependency information to complete the local build. Calling dependent requirements from a remote private warehouse.

Do you understand the above series of dazzling operations? If you don't understand, let me introduce you an extremely simple solution - Huawei Software Development Cloud  Release Warehouse!

There are four types of Maven warehouses provided by the release service: release (release warehouse), snapshot (snapshot warehouse), Mirror (central warehouse mirror warehouse), and compile and build warehouses. Among them, release and snapshot belong to tenant-level private warehouses, and users archive internal software components of users. The release version and snapshot version, and support intra-tenant dependency sharing through Maven configuration; Mirror warehouse main proxy and mirror cache the open source third-party components of the four central warehouses grails-core, maven2, jcenter, grails-plugins, which can be used as tenants The internal third-party private server warehouse is used to improve the download efficiency of dependent components; the build warehouse is a tenant project-level private warehouse, which is mainly used to archive software components built in the project.

The method of use is exactly the same as that of the remote private warehouse, but it saves all the work and resources of building and maintaining the remote private warehouse by yourself. It can be used immediately, saving manpower and material resources and improving development efficiency.

You heart it? Go to the Huawei Software Development Cloud  website to register an account and experience it!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326497938&siteId=291194637