This helped to trigger jobs when we have a merge request, using Gitlab Plugin + Gitlab Branch Source plugin, but I cannot find variables that do the following
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar \
-Dsonar.pullrequest.branch=${env.GIT_BRANCH} \
-Dsonar.pullrequest.key=${env.gitlabMergeRequestId} \
-Dsonar.pullrequest.base=${env.gitlabTargetBranch}
So still stuck. It looks like those variables (or similar variables) are not around for multibranch pipeline jobs…I’ll continue looking into options.
There is another plugin called " Gitlab Merge Request Builder Plugin" that brings some variables, but it’s not for multibranch pipelines, hence it does not look that interesting as using “Gitlab Branch Source”.