This message was deleted.
# community-support
s
This message was deleted.
1
e
if you have
src/main/java/module-info.java
then I think it'll force using JARs (but this has other effects as well)
t
Have you tried using something like:
Copy code
implementation(projects.b) {
    attributes { 
        attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
    }
}
j
Oh! I don't really know what the above does, I guess there is some mechanism by which I tag an artifact with attributes and so on? Quite interesting In any case it does do what I want yes. I had to change objects.named(LibraryElements.JAR) to objects.named(LibraryElements, LibraryElements.JAR) to make it work. I see there is documentation on this stuff so I will go have a read, thanks!
t
Ah, indeed, if you're using the Groovy DSL;
objects.named(LibraryElements.JAR)
is Kotlin. As for the documentation, it's here and here. You can run
./gradlew :b:outgointVariants
to see the variants of project B, and then choose the appropriate attribute to alter the variant selection (in this case, per dependency, rather than per-configuration as it's emphasized in the docs)
👍 1