Versioning Jenkins X Sonar, how to automate versions by build?

Good morning! I would like a help, how can I do to versioning on sonar automatically, all see that my job run on Jenkins? Do you know how to help?

Or if by chance someone has some material, so I can study to do it, I appreciate it.

Hi,

It’s not clear what you’re asking. Are you saying that you’d like your project version automatically reflected in SonarQube as it changes? And if so, how are you passing in project version? If not, then we’ll need more details on what you’re after.

 
Ann

Hello
Thank you for your willingness to help. So where do we set up SonaScanner for MsBuild, there is:

Project key -
Project name
Project version - here in this item I usually put the version, but I would like it to automatically change every time jenkins ran the job, can you tell me how I do it?
Additional arguments

Is that clearer? This quoted above is configured within the jenkins job.

Thank you!

Hi,

I think what you’re looking for is a way to put the version value into an environment variable and then I believe you can simply use that variable in the build step.

BTW, you really don’t want to change your version for every build because that interferes with housekeeping. Each time your version string changes, the analysis gets a Version Event, and analyses with events are exempt from the housekeeping algorithms. You run the risk of bloating your DB.

 
Ann

I do not know if I understood very well. What you’re trying to tell me is that I’m having a mistake, that’s right, all the controversies have a single reason, as an image follows:

image

Hi,

What I’m trying to tell you is that this is on the Jenkins side. Maybe this will help:

 
Ann

Thank you for your help. But unfortunately, I think that’s not yet it. But I understood what you mean, when we leave it in one version, and we run the project changes several times, it shows the evolution of the project.