Loading JAR for Gradle Plugin


(mh) #1

I need a particular external .jar file (not available in maven repository) from a library to run my gradle plugin. How do I need to write it so its added to the classpath?


(Peter Niederwieser) #2

How are you distributing the plugin? Does it live in ‘buildSrc’?


(mh) #3

At this point in time I am focusing on development without deployment (local). But its a good point, here is my problem: I needed to fork a LGPL project that is already hosted in maven so it would make it awkward if I would host my fork too in a maven directory. So I would love to be able to download the jar from a URI.


(Peter Niederwieser) #4

If you want to fork that project, what do you need its Jar for?

Anyway, there isn’t anything special about a plugin’s dependencies. You just put them in the ‘dependencies’ block of the plugin’s build script. If you keep the plugin in ‘buildSrc’ or publish it to a local or remote Maven/Ivy repository, transitive dependency management will make sure that users of the plugin also get the plugin’s dependencies.