I have this jvmJar task to build a jar for my back...
# serialization
m
I have this jvmJar task to build a jar for my backend
Copy code
val 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
Copy code
> 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 ?
n
i just do
shadowJar
your code works for me in a kotlin-jvm project but i needed to add the following lines because of unrelated issues
Copy code
isZip64 = true
duplicatesStrategy = DuplicatesStrategy.INCLUDE
m
If you have your project publicly visible can you share it ?