This message was deleted.
# dependency-management
s
This message was deleted.
v
Anyone?
j
You should also set
Copy code
attribute(
            Category.CATEGORY_ATTRIBUTE,
            objects.named(Category::class.java, Category.LIBRARY)
        )
LIBRARY_ELEMENTS_ATTRIBUTE
is conceptually like a "child" attribute for
CATEGORY_ATTRIBUTE = LIBRARY
see: https://docs.gradle.org/current/userguide/variant_attributes.html#ecosystem_independent_standard_attributes > Indicates the contents of a
org.gradle.category=library
variant I say conceptually, because Gradle does not know that and therefore does not give a helpful error message. Right now, technically there is no concept of relationships between attributes - probably something that might be added in the future (I know that it was discussed several times). Why it works without setting the attribute in Gradle 8, I don't know. Maybe a side effect of some change in this area.
v
Ah, thanks @Jendrik Johannes. I did not think this should be relevant, as I thought each attribute is handled on its own and only the semantic knows about "sub-attribute". I still guess this was a bug as it works with 8.0 Actually, my example was majorly simplified. The actual problem was with the
jacoco-report-aggregation
plugin which requests exactly only that that attribute in 7.6 and 8.x. But as soon as I have
org.jetbrains.kotlin:kotlin-gradle-plugin
as dependency, the report building fails with that ambiguous resolution problem which does work fine in Gradle 8.x. I just extracted the relevant lines into this stand-alone example. Requesting the category attribute in my stripped example, or in the actual project on
allCodeCoverageReportClassDirectories
configuration indeed solves the ambiguity. But I still think this is hitting some bug that is fixed in 8.0.