Mustafa Ozhan
06/25/2021, 3:43 PMval jvmJar by tasks.getting(Jar::class) {
doFirst {
manifest {
attributes["Main-Class"] = "${ProjectSettings.packageName}.backend.BackendAppKt"
from(
configurations
.getByName("runtimeClasspath")
.map { if (it.isDirectory) it else zipTree(it) }
)
}
}
}
this task is failing now with this error
> Task :backend:jvmJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':backend:jvmJar'.
> Cannot convert the provided notation to a File or URI: ZIP '/Users/mustafa.ozhan/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-serialization/1.6.0/8377a04c8a0e11d31ef17f1c0c06bda6c7b2fdc4/ktor-serialization-jvm-1.6.0.jar'.
The following types/formats are supported:
- A String or CharSequence path, for example 'src/main/java' or '/usr/include'.
- A String or CharSequence URI, for example 'file:/usr/include'.
- A File instance.
- A Path instance.
- A Directory instance.
- A RegularFile instance.
- A URI or URL instance.
- A TextResource instance.
any idea how we can fix that ?Nikky
06/25/2021, 5:29 PMshadowJar
your code works for me in a kotlin-jvm project
but i needed to add the following lines because of unrelated issues
isZip64 = true
duplicatesStrategy = DuplicatesStrategy.INCLUDE
Mustafa Ozhan
06/28/2021, 4:45 PM