When using Nexus to manage Maven repositories, upload a third-party jar with dependencies

Source: Internet
Author: User

As is well known, it is easy to build with Maven. When you use Nexus to manage Maven in your enterprise, you need to upload many third-party jar packages that are not open source. This article will tell you how to upload a third-party jar package If it has a lot of dependencies and is dependent on each other.

Core operations

Write your own pom

Ensure that all dependencies are uploaded

Steps

When you need to import DB2 drivers, you need to Db2jcc.jar, and Db2jcc.jar to rely on Db2jcc_license_cu.jar, at this time, the import method is as follows

1. Writing Pom

Manually write the Db2jcc.jar pom.xml, as follows:

<Project...>    <modelversion>4.0.0</modelversion>  <groupId>Xxx.xxx.db2driver</groupId>  <Artifactid>Db2jcc</Artifactid>  <Packaging>Jar</Packaging>  <version>1.0.0</version>  <name>Db2jcc</name>    <Dependencies>    <Dependency>      <groupId>Xxx.xxx.db2driver</groupId>      <Artifactid>Db2jcc-license-cu</Artifactid>      <version>1.0.0</version>    </Dependency>  </Dependencies></Project>

2. Importing in the GUI of Nuxus

The import method is as follows:

3. Import a dependent jar

Import the dependent Db2jcc_license_cu.jar as follows:

Note that the configuration here must follow 1. Configuration in the.

Finally, make sure that all of the dependent jars are imported into the third-party hosting repository and can be introduced in the project, configured as follows:

    <Dependency>      <groupId>Xxx.xxx.db2driver</groupId>      <Artifactid>Db2jcc</Artifactid>      <version>1.0.0</version>    </Dependency>

When using Nexus to manage Maven repositories, upload a third-party jar with dependencies

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.