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