Hello, fellow coders!
I've been programming a library, and need to add it as a dependency in my Gradle project. I simply built the library jar, then drag-and-dropped it into a directory in my project called 'lib'. Then, in my build.gradle dependencies, I added :
implementation fileTree('dir': 'lib', include: '*.jar')
This work in IntelliJ before compilation, however when I run the resulting jar, it cannot find any of the classes in the library. The problem is obviously that the library is not being packaged in the jar, but I can't seem to be able to fix that. I've tried adding this to the 'jar' task :
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it)
exclude("module-info.class") }
}
But that just gives me this error :
Circular dependency between the following tasks:
:jar
\--- :jar (*)
Please note : the Gradle project is a Fabric mod, but I don't think that should affect anything.
Any help would be very much appreciated, thanks!