Access scanner context within Jenkins Pipeline?

Hi,

i would like to get the scanner context = project scanner properties seen in background tasks / scanner context from within a running Jenkins pipeline using the sonar maven plugin.
Is this possible somehow ?
After background task has finished it seems possible via
/api/ce/task?id=AYBkezxxxxxxxxxx&additionalFields=scannerContext

Gilbert

Nevermind, i’ll go with the web api call after the waitForQualityGate() step.

Edit = for others with that problem, here is how to get the id for the web call

Note = pwd() or WORKSPACE don’t work on a Jenkins node

reportTask = findFiles(glob: '**/**/report-task.txt')
ceTaskId = readProperties(file: reportTask[0].toString())['ceTaskId']

then use ceTaskId with the web api call

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.