I am trying to use java toolchain to build my project with a specific version of java. I am using toolchain to download and use java 14 for my project. My project build fails when it has buildSrc module in it. I am getting following error
* What went wrong:
Could not determine the dependencies of null.
> Could not resolve all task dependencies for configuration ':buildSrc:buildScriptClasspath'.
> Could not resolve project :buildSrc.
Required by:
project :buildSrc
> No matching variant of project :buildSrc was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value
'8.0' but:
- Variant 'apiElements' capability :buildSrc:unspecified declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 14 and the consumer needed a component for use during runtime, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0')
- Variant 'mainSourceElements' capability :buildSrc:unspecified 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 version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0')
- Doesn't say anything about its usage (required runtime)
- Variant 'runtimeElements' capability :buildSrc:unspecified 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 14 and the consumer needed a component, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0')
- Variant 'testResultsElementsForTest' capability :buildSrc:unspecified:
- 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 version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0')
- Doesn't say anything about its usage (required runtime)
Can someone please look into the issue and help me here. Thank you!