简体   繁体   中英

Consume / import local fat jar as plugins in maven

I have recently used the Maven Assembly Plugin and also the Maven Shade Plugin in order to create a FAT JAR containing a specific plugin and its dependencies. I did this because during the build phases our company uses private servers with no access to the internet so I can't depend on public repositories.

So I have this FAT-JAR-WITH-DEP.jar and to test if it works with my module, I removed the original plugin jar from the maven repo and pasted this instead. I also removed its dependencies. the POM file remained the same. What happens is that it still tries to download the dependencies because of the pom file.

How do I use a FAT JAR as a plugin that already includes it's dependencies?

Sorry, but building such a fat jar is not a good idea. You are trying to manipulate the "inner structure" of Maven.

If you want to use Maven in an offline environment, copy all the relevant plugins and dependencies to your company Nexus/Artifactory. The easiest way to do this is run a build once against a public repository and then copy all the stuff that was downloaded through Maven.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM