0

Unlike external dependencies (from Maven, Ivy, etc.) local JAR files usually do not provide a list of transitive dependencies for Gradle. Unless they theoretically do in form of files pom.xml and pom.properties in directory META-INF/maven/<groupId>/<artifactId>. As far as I understand these are the same files Maven uses to provide transitive dependencies for an artifact.

So I wonder if Gradle is somehow able to read these transitive dependencies from a local JAR file as if the local JAR was an external dependency. Only adding the local JAR as dependency seems to ignore the embedded pom.xml.

Use case: I am writing an Plugin API JAR for an internal product which should be used by our developers to develop plugins. The API JAR has some external dependencies (Hibernate Annotations in domain classes, dom4j, stuff like that) and it would be great if the developer wouldn't have to define these dependencies by himself (they could change with newer API version). I also don't want to create a fat JAR containing all dependencies because a) the size! and b) it would not contain the sources of the external dependencies.

  • How do you distribute your plugin JAR? – Vampire Apr 25 '16 at 15:25
  • I don't distribute it. If I did I wouldn't have the problem. The JAR is made accessible via Wiki download and that's it. – sLoPPydrive Apr 26 '16 at 07:59
  • That's also a form of distribution. So every dev downloads the JAR and checks it in with their project? And if a new version is available he has to redownload it manually? Why don't you use some more sophisticated distribution? A shared drive is enough to use it as Ivy repository if you lay it out correctly. – Vampire Apr 26 '16 at 08:10

0 Answers0