Ethan K
Ethan K

Reputation: 140

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?

Upvotes: 0

Views: 249

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35805

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.

Upvotes: 1

Related Questions