Use Nexus to add jar package to private server

Use Nexus to add jar package to private server

Reprinted  at 21:35:49, January 10, 2014
  • 7413

Why build nexus private server? The reason is very simple. Some companies do not provide external network to project team personnel, so you can't use maven to access remote warehouse address, so it is necessary to find a machine with external network permission in the local area network. Set up the nexus private server, and then the developers connect to this private server, so that you can access the maven remote warehouse through this computer with the nexus private server set up.

1. First determine our environment to install the necessary environment such as maven, jdk, etc.

2. After all these are ready, go to download the latest version of nexus. Download link: 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 that there are many system versions of nexus environment

   My computer is a win7 (64) system, so I chose the windows-x86-64 version. Of course, you can choose the corresponding version according to your personal computer system

 

Open a version and you will see the following:

 

I usually install nexus as a windows service, so click install-nexus.bat, visit http://localhost:8081/nexus/ and the following page after startup, there is a Log in hyperlink in the upper right corner, click login

The default user name is admin and the password is admin123

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

 

4. Next, let's configure the proxy server of maven (provided that your computer cannot connect to the external network, if you can access the external network, it is not interesting here, just introduce it)

   Find the picture in the left menu:

   

  Click to see that 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 a lot of functions. It may be because I didn't learn the technology well and I can't use it, hehe...

     By the way, there is one more thing that you may need to pay attention to, that is, 3rd party, Snapshots, Releases, which are used to save third-party jars (a typical oracle database j driver package), snapshots within the project team, and project teams. Internal release version.

     I currently only use the third party function, 3rd party, to upload jar packages without components in the maven warehouse 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 is very simple, provided that you have established a maven project. Contains the pom.xml file, add the following to this file:

First go to the server to see the maven component of the jar

Then add the following local warehouse address in pom.xml:

Copy code
 1     <repositories>
 2         <repository>
 3             <id>nexus</id>
 4             <name>Team Nexus Repository</name>
 5             <url>http://localhost:8081/nexus/content/groups/public</url>
 6         </repository>
 7     </repositories>
 8     <pluginRepositories>
 9         <pluginRepository>
10             <id>nexus</id>
11             <name>Team Nexus Repository</name>
12             <url>http://localhost:8081/nexus/content/groups/public</url>
13         </pluginRepository>
14     </pluginRepositories>
15     <dependencies>
16         <dependency>
17             <groupId>com.oracle</groupId>
18             <artifactId>ojdbc</artifactId>
19             <version>10.1.0.2.0</version>
20         </dependency>
21     </dependencies>
Copy code

 

At this point, the construction of the nexus private server is completed. When the project team develops, they only need to add the following pom.xml information to the project’s pom.xml file to get the private server jar.

If you add other components, they will be downloaded from the nexus private server first, and then downloaded to the local. In the future, if it is found that a certain jar package already exists in the private server, it will be downloaded directly from the private server, if not, go to the network to download it. This is the benefit of building a private server. Haha...

So it is necessary to build a maven private server.

Use Nexus to add jar package to private server

Reprinted  at 21:35:49, January 10, 2014
  • 7413

Why build nexus private server? The reason is very simple. Some companies do not provide external network to project team personnel, so you can't use maven to access remote warehouse address, so it is necessary to find a machine with external network permission in the local area network. Set up the nexus private server, and then the developers connect to this private server, so that you can access the maven remote warehouse through this computer with the nexus private server set up.

1. First determine our environment to install the necessary environment such as maven, jdk, etc.

2. After all these are ready, go to download the latest version of nexus. Download link: 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 that there are many system versions of nexus environment

   My computer is a win7 (64) system, so I chose the windows-x86-64 version. Of course, you can choose the corresponding version according to your personal computer system

 

Open a version and you will see the following:

 

I usually install nexus as a windows service, so click install-nexus.bat, visit http://localhost:8081/nexus/ and the following page after startup, there is a Log in hyperlink in the upper right corner, click login

The default user name is admin and the password is admin123

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

 

4. Next, let's configure the proxy server of maven (provided that your computer cannot connect to the external network, if you can access the external network, it is not interesting here, just introduce it)

   Find the picture in the left menu:

   

  Click to see that 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 a lot of functions. It may be because I didn't learn the technology well and I can't use it, hehe...

     By the way, there is one more thing that you may need to pay attention to, that is, 3rd party, Snapshots, Releases, which are used to save third-party jars (a typical oracle database j driver package), snapshots within the project team, and project teams. Internal release version.

     I currently only use the third party function, 3rd party, to upload jar packages without components in the maven warehouse 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 is very simple, provided that you have established a maven project. Contains the pom.xml file, add the following to this file:

First go to the server to see the maven component of the jar

Then add the following local warehouse address in pom.xml:

Copy code
 1     <repositories>
 2         <repository>
 3             <id>nexus</id>
 4             <name>Team Nexus Repository</name>
 5             <url>http://localhost:8081/nexus/content/groups/public</url>
 6         </repository>
 7     </repositories>
 8     <pluginRepositories>
 9         <pluginRepository>
10             <id>nexus</id>
11             <name>Team Nexus Repository</name>
12             <url>http://localhost:8081/nexus/content/groups/public</url>
13         </pluginRepository>
14     </pluginRepositories>
15     <dependencies>
16         <dependency>
17             <groupId>com.oracle</groupId>
18             <artifactId>ojdbc</artifactId>
19             <version>10.1.0.2.0</version>
20         </dependency>
21     </dependencies>
Copy code

 

At this point, the construction of the nexus private server is completed. When the project team develops, they only need to add the following pom.xml information to the project’s pom.xml file to get the private server jar.

If you add other components, they will be downloaded from the nexus private server first, and then downloaded to the local. In the future, if it is found that a certain jar package already exists in the private server, it will be downloaded directly from the private server, if not, go to the network to download it. This is the benefit of building a private server. Haha...

So it is necessary to build a maven private server.

Why build nexus private server? The reason is very simple. Some companies do not provide external network to project team personnel, so you can't use maven to access remote warehouse address, so it is necessary to find a machine with external network permission in the local area network. Set up the nexus private server, and then the developers connect to this private server, so that you can access the maven remote warehouse through this computer with the nexus private server set up.

1. First determine our environment to install the necessary environment such as maven, jdk, etc.

2. After all these are ready, go to download the latest version of nexus. Download link: 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 that there are many system versions of nexus environment

   My computer is a win7 (64) system, so I chose the windows-x86-64 version. Of course, you can choose the corresponding version according to your personal computer system

 

Open a version and you will see the following:

 

I usually install nexus as a windows service, so click install-nexus.bat, visit http://localhost:8081/nexus/ and the following page after startup, there is a Log in hyperlink in the upper right corner, click login

The default user name is admin and the password is admin123

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

 

4. Next, let's configure the proxy server of maven (provided that your computer cannot connect to the external network, if you can access the external network, it is not interesting here, just introduce it)

   Find the picture in the left menu:

   

  Click to see that 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 a lot of functions. It may be because I didn't learn the technology well and I can't use it, hehe...

     By the way, there is one more thing that you may need to pay attention to, that is, 3rd party, Snapshots, Releases, which are used to save third-party jars (a typical oracle database j driver package), snapshots within the project team, and project teams. Internal release version.

     I currently only use the third party function, 3rd party, to upload jar packages without components in the maven warehouse 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 is very simple, provided that you have established a maven project. Contains the pom.xml file, add the following to this file:

First go to the server to see the maven component of the jar

Then add the following local warehouse address in pom.xml:

Copy code
 1     <repositories>
 2         <repository>
 3             <id>nexus</id>
 4             <name>Team Nexus Repository</name>
 5             <url>http://localhost:8081/nexus/content/groups/public</url>
 6         </repository>
 7     </repositories>
 8     <pluginRepositories>
 9         <pluginRepository>
10             <id>nexus</id>
11             <name>Team Nexus Repository</name>
12             <url>http://localhost:8081/nexus/content/groups/public</url>
13         </pluginRepository>
14     </pluginRepositories>
15     <dependencies>
16         <dependency>
17             <groupId>com.oracle</groupId>
18             <artifactId>ojdbc</artifactId>
19             <version>10.1.0.2.0</version>
20         </dependency>
21     </dependencies>
Copy code

 

At this point, the construction of the nexus private server is completed. When the project team develops, they only need to add the following pom.xml information to the project’s pom.xml file to get the private server jar.

If you add other components, they will be downloaded from the nexus private server first, and then downloaded to the local. In the future, if it is found that a certain jar package already exists in the private server, it will be downloaded directly from the private server, if not, go to the network to download it. This is the benefit of building a private server. Haha...

So it is necessary to build a maven private server.

Guess you like

Origin blog.csdn.net/My_Way666/article/details/109027474