Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add Class-Path attribute to a jar manifest in Gradle
// Add Class-Path to the existing "jar" task
tasks.jar {
val classpath = configurations.runtimeClasspath
// Input declaration is needed for the proper up-to-date checks
inputs.files(classpath).withNormalizer(ClasspathNormalizer::class.java)
manifest {
attributes(
"Class-Path" to provider { classpath.get().joinToString(" ") { it.absolutePath } }
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.