Skip to content
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

v2.0.16 dropped support for Java 8 #966

Open
jGleitz opened this issue May 1, 2021 · 4 comments
Open

v2.0.16 dropped support for Java 8 #966

jGleitz opened this issue May 1, 2021 · 4 comments
Labels
Milestone

Comments

@jGleitz
Copy link

jGleitz commented May 1, 2021

Upgrading to v2.0.16 leads to the error message below in Gradle when running in Java 8. Since v2.0.15 worked fine with Java 8, I think that this is a regression that should be fixed by correcting the Gradle metadata file of the artefacts.

> Could not resolve all files for configuration ':apis:atrium-gradle-testkit-fluent-en:testRuntimeClasspath'.
   > Could not resolve org.spekframework.spek2:spek-runner-junit5:2.0.16.
     Required by:
         project :apis:atrium-gradle-testkit-fluent-en
      > No matching variant of org.spekframework.spek2:spek-runner-junit5:2.0.16 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
          - Variant 'apiElements' capability org.spekframework.spek2:spek-runner-junit5:2.0.16 declares a library, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
          - Variant 'runtimeElements' capability org.spekframework.spek2:spek-runner-junit5:2.0.16 declares a runtime of a library, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
   > Could not find spek:spek-dsl:2.0.16.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/spek/spek-dsl/2.0.16/spek-dsl-2.0.16.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project :apis:atrium-gradle-testkit-fluent-en > org.spekframework.spek2:spek-runtime-jvm:2.0.16
   > Could not resolve org.spekframework.spek2:spek-runner-junit5:2.0.12.
     Required by:
         project :apis:atrium-gradle-testkit-fluent-en > project :api-spec > ch.tutteli.atrium:atrium-specs:0.16.0
      > No matching variant of org.spekframework.spek2:spek-runner-junit5:2.0.16 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
          - Variant 'apiElements' capability org.spekframework.spek2:spek-runner-junit5:2.0.16 declares a library, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
          - Variant 'runtimeElements' capability org.spekframework.spek2:spek-runner-junit5:2.0.16 declares a runtime of a library, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
@jGleitz
Copy link
Author

jGleitz commented May 1, 2021

In #964 @raniejade mentioned that v2.0.15 was published without Gradle metadata. I think this regression was introduced by adding this metadata.

@raniejade raniejade added this to the 2.0.17 milestone May 3, 2021
@raniejade
Copy link
Member

Yeah, unintended side-effect. A solution perhaps is to explicitly tell the kotlin plugin the JDK target. @sh-soltanpour are you able to look at this? Thanks for the report @jGleitz!

@raniejade
Copy link
Member

Looks like we need to set org.gradle.jvm.version attribute to 8. Also apparently as a workaround you can do this https://docs.gradle.org/current/userguide/component_metadata_rules.html. Apologies for the delay, I'm a bit busy with my personal life atm.

@raniejade
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants