New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
productionRuntimeClasspath fails to resolve multiplatform dependency variants #21549
Comments
Thanks for the report. It looks like a change in Boot 2.3 may have shaken loose another example of a problem that Kotlin's Gradle support has had in the past. While we may be able to copy attributes from an existing configuration to the |
@vlsi Can you please try the workaround mentioned in the issue I linked to above. Without a sample it's hard to tell exactly how it should look for you, but I think it should be something like the following:
Also, to help us to investigate further and decide if there's anything we can do in Spring Boot or if the problem needs to be addressed entirely on the Kotlin side, can you please provide a minimal sample that reproduces the failure you're seeing? You can do so by zipping something up and attaching it to this issue or by pushing it to a separate repository on GitHub. |
I feel your pain, however, the project is not open, and that is the only Kotlin multiplatform + Spring Boot project I have. It would take me time to share a reproducer.
I believe the issue is NOT Kotlin-specific.
org.gradle.libraryelements=jar and org.gradle.usage=java-runtime has nothing to do with Kotlin. They are regular attributes for a Java project. However, The following workaround works: The following workaround works as well: configurations {
productionRuntimeClasspath {
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
}
}
} However, I don't quite follow the following code in SpringBoot What was the purpose there? Did you mean I don't think it is safe to assume that |
TL;DR: please use Gradle-provided configurations (e.g. |
Setting the usage attribute makes sense. Thanks for the suggestion.
To create a configuration that extends from the same configurations as
No. If |
productionRuntimeClasspath
resolution fails for Kotlin-multiplatform project dependencies.Note:
./gradlew jar
works, andbootJar
works with Spring Boot 2.2.6.RELEASEEnvironment:
Gradle 6.3
Spring Boot 2.3.0.RELEASE (fails)
Kotlin 1.3.72
The text was updated successfully, but these errors were encountered: