Hey folks. Is it possible to define dependency con...
# plugin-development
j
Hey folks. Is it possible to define dependency constraints (or just dependency) attributes for a dependency so as to not pollute the consumable configurations (i.e.
runtimeElements
)? To make a long story short, I'm using artifact transforms to apply workspace-only changes to dependencies, but I don't want those attributes to appear in the resulting module metadata in publications.
v
Not fully sure about the use-case, but maybe you should just create additional outgoing variants with your additional attributes and disable publishing for those variants? They can have the same artifact.
j
I'm not sure I follow. How would I do that? I just need the transformer artifact to exist in the classpath for the dev environment. Is there a way to make an outgoing variant in a way where the classpath prefers it?
v
The classpath prefers what the algorithm dictates, so if you for example have a variant with an additional attribute and request that attribute, that variant will be preferred
👍 1
j
I found an alternative solution using dependency substitutions. Variants declared using dependency substitutions aren't transitive and don't show up in the resulting publications. I assume that's because dependency substitutions affect incoming artifacts only.