Answer the question
In order to leave comments, you need to log in
How to send classes of some (not all) libraries to binary in Gradle?
Initially, I needed the binary of my project to contain, in addition to my classes, also the classes of some libraries.
Found this solution for Gradle:
jar {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
Answer the question
In order to leave comments, you need to log in
Maybe so?
jar {
from {
configurations.compile.resolvedConfiguration.resolvedArtifacts.findAll {
it.moduleVersion.id.with { it.group == 'com.googlecode.json-simple' && it.name == 'json-simple' }
} collect {
it.file.with { it.isDirectory() ? it : zipTree(it) }
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question