Spring/Scala project: No matching variant of XXX was found.
Trying to add cycloneDX to an existing Gradle project. ./gradlew cyclonedxBom produces a ton of errors of the form:
Could not resolve XXX.
Required by:
project :
> No matching variant of XXX was found. The consumer was configured to find a usage of 'incremental-analysis' of a component but:
- Variant 'compile' XXX:
- Incompatible because this component declares an API of a component and the consumer needed a usage of 'incremental-analysis' of a component
- Variant 'enforced-platform-compile' capability XXX:
- Incompatible because this component declares an API of a component and the consumer needed a usage of 'incremental-analysis' of a component
- Variant 'enforced-platform-runtime' capability XXX:
- Incompatible because this component declares a runtime of a component and the consumer needed a usage of 'incremental-analysis' of a component
- Variant 'platform-compile' XXX:
- Incompatible because this component declares an API of a component and the consumer needed a usage of 'incremental-analysis' of a component
- Variant 'platform-runtime' capability XXX
- Incompatible because this component declares a runtime of a component and the consumer needed a usage of 'incremental-analysis' of a component
- Variant 'runtime' capability XXX:
- Incompatible because this component declares a runtime of a component and the consumer needed a usage of 'incremental-analysis' of a component
Not sure what to do here, don't work with these types of projects real often
Thanks for reporting this issue @allenfisher. Do you have a small reproducer ?
@glefloch Not small, but very easy to reproduce, just add id 'org.cyclonedx.bom' version '1.7.4' to https://github.com/apache/kafka
But probably because of Scala, all errors are the same.
Execution failed for task ':cyclonedxBom'.
Could not resolve all dependencies for configuration ':streams:streams-scala:incrementalScalaAnalysisFortest'. Could not resolve project :streams. Required by: project :streams:streams-scala > No matching variant of project :streams was found. The consumer was configured to find a component of category 'scala-analysis' for use during 'incremental-analysis' but: - Variant 'apiElements' capability org.apache.kafka:streams:7.6.0-0-ccs: - Incompatible because this component declares a library for use during compile-time and the consumer needed a component of category 'scala-analysis' for use during 'incremental-analysis'