Why do we need to build a nexus private server? The reason is very simple. Some companies do not provide external network to project team members, so they cannot use Maven to access the remote warehouse address. Therefore, it is necessary to find a machine with external network permissions in the local area network, build a nexus private server, and then the developers connect to this private server. In this way, they can access Maven's remote warehouse through the computer with the nexus private server. 1. First, make sure that our environment has installed Maven, JDK and other necessary environments 2. After all these are ready, go download the latest version of nexus Download address: http://www.sonatype.org/nexus/go I installed nexus-2.2-01-bundle locally, and the latest version is nexus-2.4.0-09-bundle 3. Open the directory nexus-2.4.0-09-bundle\nexus-2.4.0-09\bin\jsw. Under this directory, you will find many system versions of the nexus environment. My computer is Win7 (64) system, so I chose the Windows-x86-64 version. Of course, you can choose the corresponding version according to your computer system. Open a version and you will see something like this: I usually install nexus as a Windows service, so click install-nexus.bat and visit http://localhost:8081/nexus/. After startup, the following page appears. There is a Log in hyperlink in the upper right corner. Click to log in. The default username is admin and the password is admin123 After logging in, you can modify your login information on the left: 4. Next, let's configure Maven's proxy server (assuming your computer cannot connect to the Internet. If you can, there is no point in going into this, just introducing it) In the left menu, find the picture below: Click to view there are many options on the right, find here Just add your proxy server. 5: Next, it seems that there is no need to configure anything here. Anyway, I didn’t use many functions. Maybe I didn’t learn the technology well and didn’t know how to use it, haha… By the way, there is another thing you may need to pay attention to, which is 3rd party, Snapshots, and Releases, which are used to save third-party jars (typically Oracle database j driver packages), snapshots within the project team, and releases within the project team. I am currently just using the 3rd party function to upload the jar package without components in the Maven repository to the server. How to upload a third-party jar to Nexus? As follows: For example, upload the Oracle driver package Now that Nexus has been installed, how to use the uploaded jar package? It is very simple, provided that you have already created a Maven project. Contains the pom.xml file, add the following to this file: First go to the server to look at the Maven component of the jar Then add the following local warehouse address in pom.xml: <repositories> <repository> <id>nexus</id> <name>Team Nexus Repository</name> <url>http://localhost:8081/nexus/content/groups/public</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>Team Nexus Repository</name> <url>http://localhost:8081/nexus/content/groups/public</url> </pluginRepository> </pluginRepositories> <dependencies> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc</artifactId> <version>10.1.0.2.0</version> </dependency> </dependencies> At this point, the construction of the nexus private server has been completed. When the project team developers develop, they only need to add the following pom.xml information in the project's pom.xml file to obtain the private server jar. If you add other components, they will be downloaded to the nexus private server first and then downloaded to the local computer. In the future, if a jar package is found to already exist in the private server, it will be downloaded directly from the private server. If not, it will not be downloaded from the Internet. This is the benefit of building a private server. Ha ha........ Therefore, it is necessary to build a Maven private server. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: MySQL 5.7 mysql command line client usage command details
>>: React State state and life cycle implementation method
Table of contents Single Node Diff reconcileSingl...
The innodb_autoinc_lock_mode parameter controls t...
CSS Viewport units have been around for the past ...
Mysql stored procedure 1. Create stored procedure...
This effect is most common on our browser page. L...
Preface In JavaScript, this is the function calli...
Preface In the development process, defining vari...
Table of contents Standards for smooth animation ...
This article records the installation of MySQL 8....
<br />Since the Ministry of Foreign Affairs ...
Edit /etc/docker/daemon.json and add the followin...
Table of contents Preface Main implementation cod...
In writing styles, we can often see this situatio...
1. Check whether port 80 is occupied. Generally, ...
This article introduces the installation of Windo...