We have an old playframework 1.2.x version where we copy all the jars to project/lib so playframework can consume them. We would LOVE to copy all the source jars as well so
Here eskatos solution translated in Kotlin DSL:
tasks {
"copySourceJars"(Copy::class) {
val sources = configurations.runtime.resolvedConfiguration.resolvedArtifacts.map {
with(it.moduleVersion.id) {
dependencies.create(group, name, version, classifier = "sources")
}
}
from(
configurations.detachedConfiguration(*sources.toTypedArray())
.resolvedConfiguration.lenientConfiguration.getFiles(Specs.SATISFIES_ALL)
)
into(File("some-directory"))
}
}