Hi @90abyss,
You can use zipTree()
to work with the content of the jar rather than the jar file itself. Here is a complete example taking a jar
from the classpath and packaging its content into your jar
:
plugins {
id 'java-library'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.apache.commons:commons-lang3:3.9'
}
jar {
from provider {
zipTree(configurations.compileClasspath.filter {
it.name == 'commons-lang3-3.9.jar'
}.singleFile)
}
}