Nexus build maven private server details

Building with Maven is very convenient. When using Nexus to create a private server to manage Maven in an enterprise, many third-party Jar packages without open source need to be uploaded. This article will describe how to upload when there are many third-party Jar packages and they depend on each other.


http://localhost:10086/nexus/#welcome
http://books.sonatype.com/nexus-book/reference/index.html
http://mvnrepository.com/

Core operation Write

your own POM

to ensure all dependencies are uploaded

Steps

When When you need to import the DB2 driver, you need db2jcc.jar, and db2jcc.jar depends on db2jcc_license_cu.jar. At this time, the import method is as follows

1. Write POM

Manually write pom.xml of db2jcc.jar as follows:

Copy code
<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>
 

    <dependency>
      <groupId>xxx.xxx.db2driver</groupId>
      <artifactId>db2jcc-license-cu</artifactId>
      <version>1.0.0</version>
    </dependency>
  </dependencies>
</project>
copy code
2. Import in Nuxus GUI The

import method is as follows:



3. Import dependent jars

Import dependent db2jcc_license_cu.jar as follows:



Note that the configuration here must be in accordance with 1. configuration in .

Finally, after ensuring that all dependent jars are imported into the third-party host repository, they can be imported into the project. The configuration is as follows:

    <dependency>
      <groupId>xxx.xxx.db2driver</groupId>
      <artifactId>db2jcc</artifactId>
      < version>1.0.0</version>
    </dependency>
tags: JAVA, Maven,














3) Click Save to finish



Guess you like

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