{
    "componentChunkName": "component---src-templates-plugin-docs-tsx",
    "path": "/plugins/scm-sonar-plugin/docs/latest/en/config/",
    "result": {"data":{"plugin":{"name":"scm-sonar-plugin","displayName":"Sonar integration","description":"Shows CI status for Sonar analysis","author":"Cloudogu GmbH","documentation":[{"version":"3.0.x","languages":["de","en"]},{"version":"1.1.x","languages":["en","de"]},{"version":"1.0.x","languages":["de","en"]}]},"navigation":{"nodes":[{"section":"Configuration","entries":[{"frontmatter":{"title":"Configuration","subtitle":"Sonar Webhooks Setup","partiallyActive":null},"fields":{"slug":"/plugins/scm-sonar-plugin/docs/3.0.x/en/config/"}}]}]},"versions":{"group":[{"fieldValue":"1.0.x"},{"fieldValue":"1.1.x"},{"fieldValue":"3.0.x"}]},"languages":{"group":[{"fieldValue":"de"},{"fieldValue":"en"}]},"markdownRemark":{"html":"<h1 id=\"setup\" style=\"position:relative;\"><a href=\"#setup\" aria-label=\"setup permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setup</h1>\n<p>The Sonar plugin allows to receive Sonar analyses that can be sent by SonarQube or SonarCloud via webhooks.\nFor this purpose, the plugin provides two REST endpoints to evaluate the analysis result of the webhooks and attach it to the analysed commit in the repository.\nThe setup of the webhooks should hardly differ in the tools.</p>\n<h2 id=\"sonarcloud-webhook\" style=\"position:relative;\"><a href=\"#sonarcloud-webhook\" aria-label=\"sonarcloud webhook permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>SonarCloud Webhook</h2>\n<p>In SonarCloud webhooks can be defined per project or per organization.\nThe webhooks are triggered automatically after running an analysis, regardless of the analysis result.\nThe recommended procedure for setting up Sonar webhooks against the SCM Manager server is presented here.</p>\n<h3 id=\"example\" style=\"position:relative;\"><a href=\"#example\" aria-label=\"example permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h3>\n<p>We set up a new webhook for our Sonar project. For this we choose as URL the endpoint in SCM-Manager: <code class=\"language-text\">https://{instanceUrl}/scm/api/v2/sonar</code>.\nFor this webhook to be accepted at the SCM manager, credentials must be sent along.\nThis usually involves choosing a technical user who must have the rights to write CI statuses.\nUsername and password can be written in the front part of the URL, e.g. <code class=\"language-text\">https://Testuser:Password123@{instanceUrl}/scm/api/v2/sonar</code>.\nInstead of the password we can also use a SCMM API key.\nThe payload of the Sonar webhook is automatically generated from the analysis data.</p>\n<p>In order for the SCM-Manager to recognize which repository it is when it receives the webhook, the repository name must be supplied with the special key <code class=\"language-text\">sonar.analysis.scmm-repo</code>.\nThe value of the key must contain <code class=\"language-text\">{repositoryNamespace}}/{repositoryName}}</code>.</p>\n<p>Example of triggering a SonarCloud analysis:\n<code class=\"language-text\">sonarqube -Dsonar.organization=scm-manager -Dsonar.branch.name=develop -Dsonar.analysis.scmm-repo=scm-manager-plugins/scm-tagprotection-plugin</code></p>\n<p>For more information on Sonar webhooks, see the <a href=\"https://docs.sonarcloud.io/advanced-setup/webhooks/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">documentation</a>.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 590px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 22.972972972972975%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAtUlEQVQY02VQWw6DMAzr/Y+z/x0GiWnrBggofZA2eEpRKqZ9WKlcx3Fiuq7HsjjkXLDvBKIMImoQLqUT17fopEfBXHC/WZhH/4K1A8ZxxjTNGIcF9ulgnys+b4dtC/A+1CpwzleIIfOBUrhhnnYYnaQ1xh0pSkpGJgYzt6RqcHK5GWvKAwwj00UohIh9iFidRwipJhI+hAjvY/1XnXCy0dWQqMBc71DKeUdX14sV2qBmv3r+4788A4XsnS1COgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"SonarCloud Webhook\"\n        title=\"SonarCloud Webhook\"\n        src=\"/static/f3966a63c4a3c3ebca645d971d336e09/fcda8/sonarcloud_webhook.png\"\n        srcset=\"/static/f3966a63c4a3c3ebca645d971d336e09/12f09/sonarcloud_webhook.png 148w,\n/static/f3966a63c4a3c3ebca645d971d336e09/e4a3f/sonarcloud_webhook.png 295w,\n/static/f3966a63c4a3c3ebca645d971d336e09/fcda8/sonarcloud_webhook.png 590w,\n/static/f3966a63c4a3c3ebca645d971d336e09/efc66/sonarcloud_webhook.png 885w,\n/static/f3966a63c4a3c3ebca645d971d336e09/c83ae/sonarcloud_webhook.png 1180w,\n/static/f3966a63c4a3c3ebca645d971d336e09/3f8aa/sonarcloud_webhook.png 1337w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span></p>","description":"Setup The Sonar plugin allows to receive Sonar analyses that can be sent by SonarQube or SonarCloud via webhooks.\nFor this purpose, the plugin provides two REST…","tableOfContents":"<ul>\n<li>\n<p><a href=\"#setup\">Setup</a></p>\n<ul>\n<li>\n<p><a href=\"#sonarcloud-webhook\">SonarCloud Webhook</a></p>\n<ul>\n<li><a href=\"#example\">Example</a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>","frontmatter":{"title":"Configuration","subtitle":"Sonar Webhooks Setup","description":null,"keywords":null,"displayToc":null,"image":null}}},"pageContext":{"name":"scm-sonar-plugin","slug":"/plugins/scm-sonar-plugin/docs/3.0.x/en/config/","version":"3.0.x","latestVersion":"3.0.x","latestPageVersion":"3.0.x","language":"en","canonicalPath":"/plugins/scm-sonar-plugin/docs/latest/en/config/","latestRootPath":"/plugins/scm-sonar-plugin/docs/3.0.x/en/"}},
    "staticQueryHashes": ["1973669194","2742214048","2956773653","2957019495","698804963"]}