[英]How to add a fat/uber jar as dependency in pom.xml
I'm newbie on maven.我是 maven 的新手。
My question is this:我的问题是:
I have a far jar in nexus, and want to add it as dependency in a pom.xml.我在 nexus 中有一个 far jar,并想将其添加为 pom.xml 中的依赖项。 How can I do that?
我怎样才能做到这一点?
In nexus there are both the jar and the fat jar.在 nexus 中同时存在 jar 和 fat jar。
Inside my pom.xml I'm using:在我的 pom.xml 中,我正在使用:
<dependency>
<groupId>com.xxxxxxxxxxxx.sar</groupId>
<artifactId>kafka-connector</artifactId>
<version>5.0.0-SNAPSHOT</version>
</dependency>
and, of course, it is not downloading the fat jar. How do I fix that?而且,当然,它不会下载胖子 jar。我该如何解决这个问题?
Using a classifier is the right way to go:使用分类器是 go 的正确方法:
<dependency>
<groupId>com.xxxxxxxxxxxx.sar</groupId>
<artifactId>kafka-connector</artifactId>
<version>5.0.0-SNAPSHOT</version>
<classifier>fat</classifier>
</dependency>
I would check if the fat is a consumable artifact.我会检查脂肪是否是消耗性神器。
add the dependency to your pom.xml将依赖项添加到您的 pom.xml
<dependency>
<groupId>com.xxxxxxxx</groupId>
<artifactId>example-app</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/yourJar.jar</systemPath>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.