Adding tags to a scan via properties file?


(Alex) #1

Hi,

Is it possible to add tags to a project within the sonar-projects.properties file?

There’s no mention of it in the documentation (from what i’ve seen) - it would not be good if we (the administrators) have to do this manually on the project page.

Thanks


(G Ann Campbell) #2

Hi,

This is not possible.

Would you explain why, please? Project tags are not meant to be ephemeral; changing from analysis to analysis. They’re meant to categorize the project as a whole.

 
Ann


(Thomas Jenny) #3

We would use the feature to tag the project (e.g. technology, or architectural context).
We would use the tags within Sonarqube then to define portfolios with the help of the tags, without the need to manually maintain this.


(G Ann Campbell) #4

Hi @thjenny,

Your use case is perfectly supported - via the UI.

 
:slight_smile:
Ann


(Thomas Jenny) #5

Hi Ann,
I know that I can do this via the UI, but I’d like to automate this, as I said: “without the need to manually maintain this”.
So no, not “perfectly” supported. If we can automate this, we could define these project attributes or tags in the source itself in one place, and the build process could use it in multiple contexts, for Sonar, but also e.g. to link to the architectural documentation, …


(G Ann Campbell) #6

Hi,

The UI uses web services (api/project_tags/set). Your automation could too.

 
Ann