Build Maven private server with nexus

Source: Internet
Author: User

1. First, make sure that Maven and JDK are installed in our environment.

2. After these are ready, download the latest version of nexus: 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 Nexus-2.4.0-09-bundle \ nexus-2.4.0-09 \ bin \ JSW directory and you will find many system versions of the nexus environment.

My computer is win7 (64) for the system, so I chose the windows-x86-64 version, of course, according to the personal computer system to select the corresponding version

 

Open a version and you will see the following:

 

I usually install nexus as a Windows service, so click the install-nexus.bat, visit http: // localhost: 8081/nexus/after the startup of the following page, there is a log in hyperlink in the upper right corner, click to log on

The default username is admin and the password is admin123.

After logging on, you can modify the logon information on the left side:

 

4. Next, we will configure the maven Proxy Server (provided that your computer cannot connect to the Internet. If you can connect to the Internet, it will be meaningless here, just to introduce it)

Find

Click here to view the many options on the right.

Add your proxy server.

5: Next, it seems that no configuration is required here. I didn't use many functions anyway. It may be because the technology is poor and won't be used ....

By the way, you may need to note that 3rd party, snapshots, and releases are used to save third-party jar (J driver package of a typical Oracle database ), snapshots within the project team and releases within the project team.

Currently, I only use the third-party function 3rd party to upload jar packages without any components in the maven repository to the server. How can I upload third-party jar files to nexus? Example: upload an oracle driver package

 

 

 

Now that nexus has been installed, how to use the uploaded jar package is simple, provided that you have created a Maven project. Add the file Pom. XML as follows:

Go to the server and check the maven component of jar.

Then add the following local repository address to Pom. xml:

 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>

 

At this point, the establishment of the nexus private server has been completed. When developing the project team, you only need to add the following Pom. XML Information to the Pom. xml file of the project to obtain the jar of the private server.

If other components are added, they will be downloaded from the Nexus private server before being downloaded to the local device. If a jar package already exists in the private server, it will be downloaded directly from the private server. If it is not downloaded from the internet. This is the benefit of building private servers. Haha ........

Therefore, it is necessary to build a Maven private server.

Build Maven private server with nexus

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.