Slackbot
08/14/2023, 2:01 PMSteve Ebersole
08/14/2023, 2:02 PMChris Lee
08/14/2023, 2:03 PMSteve Ebersole
08/14/2023, 2:03 PMSteve Ebersole
08/14/2023, 2:04 PMCould not determine the dependencies of task ':hibernate-gradle-plugin:checkstyleMain'.
> Could not resolve all task dependencies for configuration ':hibernate-gradle-plugin:compileClasspath'.
> Could not resolve project :hibernate-core.
Required by:
project :hibernate-gradle-plugin
> No matching variant of project :hibernate-core was found. The consumer was configured to find a library for use during compile-time, compatible with Java 11, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.2.1' but:
- Variant 'apiElements' capability org.hibernate.orm:hibernate-core:6.3.0-SNAPSHOT declares a library for use during compile-time, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 20 and the consumer needed a component, compatible with Java 11
- Other compatible attributes:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.2.1')
- Variant 'javadocElements' capability org.hibernate.orm:hibernate-core:6.3.0-SNAPSHOT declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 11)
- Doesn't say anything about its elements (required them preferably in the form of class files)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.2.1')
- Variant 'mainSourceElements' capability org.hibernate.orm:hibernate-core:6.3.0-SNAPSHOT declares a component, and its dependencies declared externally:
- Incompatible because this component declares a component of category 'verification' and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 11)
- Doesn't say anything about its elements (required them preferably in the form of class files)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.2.1')
- Doesn't say anything about its usage (required compile-time)
- Variant 'runtimeElements' capability org.hibernate.orm:hibernate-core:6.3.0-SNAPSHOT declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 20 and the consumer needed a component, compatible with Java 11
- Other compatible attributes:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.2.1')
- Variant 'sourcesElements' capability org.hibernate.orm:hibernate-core:6.3.0-SNAPSHOT declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 11)
- Doesn't say anything about its elements (required them preferably in the form of class files)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.2.1')
- Variant 'testResultsElementsForTest' capability org.hibernate.orm:hibernate-core:6.3.0-SNAPSHOT:
- Incompatible because this component declares a component of category 'verification' and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 11)
- Doesn't say anything about its elements (required them preferably in the form of class files)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.2.1')
- Doesn't say anything about its usage (required compile-time)
Vampire
08/14/2023, 2:05 PMIncompatible because this component declares a component, compatible with Java 20 and the consumer needed a component, compatible with Java 11
Chris Lee
08/14/2023, 2:05 PMIncompatible because this component declares a component, compatible with Java 20 and the consumer needed a component, compatible with Java 11
Vampire
08/14/2023, 2:05 PMVampire
08/14/2023, 2:07 PMorg.hibernate.orm:hibernate-core:6.3.0
is compiled with target Java 20, hibernate-gradle-plugin
requests hibernate-core
compatible with Java 11.
You could tell Gradle you don't care about variant, but that would just make it fail at runtime for trying to read Java 20 class files while running on Java 11.Vampire
08/14/2023, 2:09 PMhibernate-core
but use JVM toolchains to build hibernate-gradle-plugin
and run Gradle with Java 20 on CI but Java 11 locally.
So locally the built hibernate-core
would be compatible with Java 11 while on CI it is only compatible with Java 20.
That's why it is a good idea to decouple the JVM you use to run Gradle from the JVM that is used to build / test / run your production code by using JVM toolchains everywhere. 🙂Steve Ebersole
08/14/2023, 2:11 PMVampire
08/14/2023, 2:11 PMSteve Ebersole
08/14/2023, 2:12 PMSteve Ebersole
08/14/2023, 2:13 PMChris Lee
08/14/2023, 2:14 PMVampire
08/14/2023, 2:15 PMSteve Ebersole
08/14/2023, 2:56 PMSteve Ebersole
08/14/2023, 6:27 PM