Is it possible to use attributes for some sort of ...
# community-support
s
Is it possible to use attributes for some sort of metadata that is not used for artifact selection but rather read afterwards? e.g. a description or the name of a particular file inside the artifact? Will it work or will it backfire somehow?
v
It will probably work, but it will most likely backfire 🙂
An attribute that is there but not requested is considered compatible, so it shouldn't disturb resolution. So you can read it later on, but they are not really designed for that and also have different types depending on whether they come from runtime API or form a Gradle Module Metadata file and so on.
I for example used attributes for further selection like getting all cross-platform artifacts vs. getting os-specific artifacts judging by
OPERATING_SYSTEM_ATTRIBUTE
. It was not trivial an needed much fiddling.