Hello community!
As mentioned on Branch analysis setup the sonar.branch.target parameter can be used to specify a base branch for the new code definition of short-living branches.
However, our attempts with this fail - only the project’s main branch is displayed as the reference branch.
The parameter is also not mentioned on Analysis Parameters.
Is the parameter still supported or not? Either one of the documentation pages seems to be wrong.
We use:
Jenkins Pipelines
Maven Scanner (sonar-maven-plugin 4.0.0.4121)
I have tried to specify the parameter via command line parameter (-D) or via pom property.
sonar.branch.name should be the name of the branch you want to analyze, and sonar.branch.target is the name of the branch you imagine you will eventually merge into.
It’s… debatable, since we mention them in our branch analysis docs. You can consider that we don’t list all our test coverage parameters in the analysis parameters docs either.
Anyways, I’ll throw it over to our Docs folks and let them decide. Thanks for the feedback!
No, I think that’s correct. The BRANCH_NAME environment variable is set by Jenkins, it’s the branch of the current build. Target is “development” in this case, where the current branch has branched off and will be merged back later.