Giter Site home page Giter Site logo

sonar-bitbucket-plugin's Introduction

Bitbucket Cloud plug-in for SonarQube

Travis build status

PLEASE NOTE: This repository is ARCHIVED as it only supports SonarQube versions < 7.7 due do the required preview mode

Download it from Github releases page

This SonarQube plug-in creates pull request comments for issues found in your Bitbucket Cloud pull requests. It is very similar and inspired by the SonarQube Github plug-in, but targets Bitbucket Cloud. It creates a summary of the found issues as a global pull request comment which looks like this:

Screenshot global pull request comment

For every found issue on changed or new lines of the pull request, it will also create a pull request comment with the severity, the explanation what this issue is about and a link to get more details about it:

Screenshot exampl pull request comment

And it can also approve/unapprove the pull request and update the build status according to the SonarQube analysis results (if there are any blocker or critical issues found, the build is considered failed and the pull request unapproved):

Screenshot build status

Usage

Prerequisites

  • SonarQube >= 6.7.x and SonarQube < 7.7.x
  • A Bitbucket Cloud account
  • Maven 3.x + JDK (to manually build it)

Important facts

  • This plug-in only supports Git (no Mercurial) repositories.
  • It can only be run in SonarQube's "preview/issues" mode. You cannot use it with "publish" (persistent) mode!

Installation

The plug-in will probably once be available in the SonarQube update center. Until then, you can download it from our Github releases page.

If you want, you can also build the plug-in manually like follows:

mvn clean install

After you copied the plugin's JAR to {SONARQUBE_INSTALL_DIRECTORY}/extensions/plugins, you need to restart your SonarQube instance.

Troubleshooting

If you experience any issues with the plug-in, check the build log for any suspicious messages first. The plug-in writes messages to the log with the prefix [sonar4bitbucket]. Possible issues are often related to authentication. Please make sure that you have configured a callback URL in Bitbucket when using OAuth. If authentication worked but you don't see any pull request comments being made for code issues, run the build in debug mode, create a bug report and attach important debug log lines to it. To generate a log with debug level, use the following parameters to trigger SonarQube:

mvn sonar:sonar -X -Dsonar.verbose=true ...

Configuration for Jenkins with Maven

You need to run this plug-in as part of your build. Add a build step of type Execute shell to your Jenkins job with the following content:

mvn clean verify sonar:sonar --batch-mode --errors \
     -Dsonar.bitbucket.repoSlug=YOUR_BITBUCKET_REPO_SLUG \
     -Dsonar.bitbucket.accountName=YOUR_BITBUCKET_ACCOUNT_NAME \
     -Dsonar.bitbucket.teamName=YOUR_BITBUCKET_TEAM_NAME \
     -Dsonar.bitbucket.apiKey=YOUR_BITBUCKET_API_KEY \
     -Dsonar.bitbucket.branchName=$GIT_BRANCH \
     -Dsonar.host.url=http://YOUR_SONAR_SERVER \
     -Dsonar.login=YOUR_SONAR_LOGIN \
     -Dsonar.password=YOUR_SONAR_PASSWORD \
     -Dsonar.analysis.mode=issues

See this table about the possible configuration options:

Parameter name Description Default value Example
sonar.bitbucket.repoSlug The slug of your Bitbucket repository (https://bitbucket.org/[account_name]/[repo_slug]). sonar-bitbucket-plugin
sonar.bitbucket.accountName The Bitbucket account your repository belongs to (https://bitbucket.org/[account_name]/[repo_slug]). mibexsoftware
sonar.bitbucket.teamName If you want to create pull request comments for Sonar issues with an app password, provide your Bitbucket user name here. a_team
sonar.bitbucket.apiKey If you want to create pull request comments for Sonar issues with an app password, provide your app password here.
sonar.bitbucket.oauthClientKey If you want to create pull request comments for Sonar issues under your personal account, provide the client key of the new OAuth consumer here (needs repository and pull request WRITE permissions).
sonar.bitbucket.oauthClientSecret If you want to create pull request comments for Sonar issues under your personal account, provide the OAuth client secret for the new OAuth consumer here.
sonar.bitbucket.branchName The branch name you want to get analyzed with SonarQube. When building with Jenkins, use $GIT_BRANCH. For Bamboo, you can use ${bamboo.repository.git.branch}. $GIT_BRANCH
sonar.bitbucket.pullRequestId The ID of the pull request to analyze with SonarQube. 1
sonar.bitbucket.branchIllegalCharReplacement If you are using SonarQube version <= 4.5, then you have to escape '/' in your branch names with another character. Please provide this replacement character here. _
sonar.bitbucket.minSeverity Either INFO, MINOR, MAJOR, CRITICAL or BLOCKER to only have pull request comments created for issues with severities greater or equal to the chosen severity. MAJOR CRITICAL
sonar.bitbucket.approvalFeatureEnabled If enabled, the plug-in will approve the pull request if there are no issues with severity >= sonar.bitbucket.maxSeverityApprovalLevel, otherwise it will unapprove the pull request. true false
sonar.bitbucket.buildStatusEnabled If enabled, the plug-in will update the build status of the pull request depending on the Sonar analysis result. The analysis and also the build is failed if there are any critical or blocker issues. true false
sonar.bitbucket.maxSeverityApprovalLevel If any issues of this level or higher are found, it will unapprove the pull request. CRITICAL MAJOR

For authentication, you have to decide between if you want to create pull request comments under by using OAuth or with an app password.

If you go with OAuth, you have to configure a callback URL and use the Bitbucket permissions "Repository write" and "Pull requests write" (for commenting on the pull request) as well as "Account read" for the new OAuth consumer. The permissions should look like follows:

Permissions necessary for OAuth consumer

If everything is configured as explained, you should see pull request comments for all found Sonar issues in your pull request after the next push to your Bitbucket repository.

Configuration for Bamboo with Maven

You need to run this SonarQube plug-in as part of your build. To achieve this, add a build task of type Maven 3.x to your Bamboo job with the following task goal:

clean verify sonar:sonar --batch-mode --errors \
     -Dsonar.bitbucket.repoSlug=YOUR_BITBUCKET_REPO_SLUG \
     -Dsonar.bitbucket.accountName=YOUR_BITBUCKET_ACCOUNT_NAME \
     -Dsonar.bitbucket.teamName=YOUR_BITBUCKET_TEAM_ID \
     -Dsonar.bitbucket.apiKey=YOUR_BITBUCKET_API_KEY \
     -Dsonar.bitbucket.branchName=${bamboo.repository.git.branch} \
     -Dsonar.host.url=http://YOUR_SONAR_SERVER \
     -Dsonar.login=YOUR_SONAR_LOGIN \
     -Dsonar.password=YOUR_SONAR_PASSWORD \
     -Dsonar.analysis.mode=issues

Configuration with Bitbucket Pipelines

To configure for use with Bitbucket Pipelines You will need to add the following environment variables:

  • OAUTH_CLIENT_KEY
  • OAUTH_CLIENT_SECRET
  • SONAR_HOST_URL
  • SONAR_LOGIN
  • SONAR_PASSWORD

The minimal configuration for Pipelines is as follows:

# The Sonar Bitbucket plug-in will run on the default Pipeline.
# -----
image: maven:3.5.0

pipelines:
  default:
    - step:
        script:
          - mvn clean test
          - mvn sonar:sonar --batch-mode --errors -Dsonar.bitbucket.repoSlug=$BITBUCKET_REPO_SLUG -Dsonar.bitbucket.accountName=$BITBUCKET_REPO_OWNER -Dsonar.bitbucket.oauthClientKey=$OAUTH_CLIENT_KEY -Dsonar.bitbucket.oauthClientSecret=$OAUTH_CLIENT_SECRET -Dsonar.bitbucket.branchName=$BITBUCKET_BRANCH -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.password=$SONAR_PASSWORD -Dsonar.analysis.mode=issues

Note: The Pipeline must run at least once after the pull request is created.

Configuration with SonarRunner

The configuration of the SonarRunner parameters is actually the same as with Maven. Just run SonarRunner like follows:

sonar-runner -Dsonar.analysis.mode=issues <other-options>

Using a proxy

If you use a proxy, you can configure the host and port like follows:

-Dhttp.proxyHost=http://localhost -Dhttp.proxyPort=9000

sonar-bitbucket-plugin's People

Contributors

healarconr avatar jgrodskiy-donlen avatar mrueegg avatar peterosudio avatar thomasturrell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonar-bitbucket-plugin's Issues

Does sonar-bitbucket-plugin work for non-Maven project?

Expected Behavior

EDF client to add the following SonarQube plugin for their application. This Sonarqube plug-in creates pull request comments for issues found in your Bitbucket Cloud pull requests. It creates a summary of the found issues as a global pull request comment. Its a non-maven project.

Actual Behavior

Sonar report & comments should be visible to source code file in Bit-bucket however this is not happening right now. We need to check if plugin supports non-maven projects also.

Plug-in version, SonarQube version, CI system, build type

https://github.com/mibexsoftware/sonar-bitbucket-plugin

I am using sonar-bitbucket-plugin for my non Maven project. I have done below configuration in Jenkins job' "SONAR Scanner" text box:

sonar.analysis.mode=issues
sonar.bitbucket.login=test
sonar.bitbucket.password=$PASSWD
sonar.bitbucket.repository=https://$repo_url/pullrequests/$PULL_REQUEST_ID
sonar.bitbucket.pullRequestId=$PULL_REQUEST_ID
sonar.bitbucket.minSeverity=MAJOR
sonar.bitbucket.buildStatusEnabled=true

Kindly confirm if this plugin can be used in non-Maven project and if yes, what is the setting that I am missing.

Compatibility with Bitbucket Server?

I'm aware that mibexsoftware also distributes a plugin to be installed on bitbucket server:
https://marketplace.atlassian.com/plugins/ch.mibex.stash.sonar4stash/server/overview

However, that's a totally different approach and requires you to have admin permissions to install plugins on the server.

I really like the lightweight approach of this plugin here to simply add comments in combination with running sonar-scanner in preview mode. That's exactly what we would need. Just for bitbucket server instead of bitbucket cloud...

I was wondering why the functionality is not there yet. Is it because the REST APIs between bitbucket server and cloud so vastly different?

SonarReviewPostJob fails with NullPointerException

On a repository I have the following error.

INFO: 11421/11421 components tracked
INFO: ANALYSIS SUCCESSFUL
INFO: Executing post-job ch.mibex.bitbucket.sonar.review.SonarReviewPostJob
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:41.490s
INFO: Final Memory: 76M/2377M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.NullPointerException
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1$$anonfun$apply$1.apply(BitbucketClient.scala:83)
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1$$anonfun$apply$1.apply(BitbucketClient.scala:78)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
at scala.collection.immutable.List.map(List.scala:285)
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1.apply(BitbucketClient.scala:78)
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1.apply(BitbucketClient.scala:77)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.fetchPage(BitbucketClient.scala:234)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.ch$mibex$bitbucket$sonar$client$BitbucketClient$$fetchPullRequestsPage$1(BitbucketClient.scala:76)

Looking at the source code, it seems the error should be cause by a non existing hash on "destination->commit->hash"

I manually checked the 114 pull requests JSON from this repository and they're all with existing hashes.

{
      "description": "XXXXXXXX",
      ...
      "title": "XXXXXXX",
      "close_source_branch": true,
      "merge_commit": null,
      "destination": {
        "commit": {
          "hash": "XXXXXXXXXXX",
          "links": {
            "self": {
              "href": "https://bitbucket.org/!api/2.0/repositories/XXXXXXX"
            }
          }
        },
        ...

I'm not sure how to proceed further.

NPE in SonarBBPluginConfig.validate

Hi, I'm trying to configure this plugin (v1.1.5) with our SonarCuber server (v6.1) and I'm getting NullPointerException during scans. Am I missing something in the configuration or could be something wrong with sonar cube/plugin instalation?

[Sonar] 15:35:35.638 ERROR: Error during SonarQube Scanner execution
[Sonar] java.lang.NullPointerException
[Sonar] 	at ch.mibex.bitbucket.sonar.SonarBBPluginConfig.validate(SonarBBPluginConfig.scala:63)
[Sonar] 	at ch.mibex.bitbucket.sonar.cache.InputFileCacheSensor.shouldExecuteOnProject(InputFileCacheSensor.scala:17)
[Sonar] 	at org.sonar.scanner.bootstrap.BatchExtensionDictionnary.shouldKeep(BatchExtensionDictionnary.java:260)
[Sonar] 	at org.sonar.scanner.bootstrap.BatchExtensionDictionnary.getFilteredExtensions(BatchExtensionDictionnary.java:101)
[Sonar] 	at org.sonar.scanner.bootstrap.BatchExtensionDictionnary.select(BatchExtensionDictionnary.java:74)
[Sonar] 	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:45)
[Sonar] 	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
[Sonar] 	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182)
[Sonar] 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[Sonar] 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[Sonar] 	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:247)
[Sonar] 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:242)
[Sonar] 	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:232)
[Sonar] 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[Sonar] 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[Sonar] 	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
[Sonar] 	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
[Sonar] 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[Sonar] 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[Sonar] 	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
[Sonar] 	at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118)
[Sonar] 	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
[Sonar] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[Sonar] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[Sonar] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[Sonar] 	at java.lang.reflect.Method.invoke(Method.java:498)
[Sonar] 	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
[Sonar] 	at com.sun.proxy.$Proxy0.execute(Unknown Source)
[Sonar] 	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
[Sonar] 	at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
[Sonar] 	at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
[Sonar] 	at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
[Sonar] 	at `org.sonarsource.scanner.cli.Main.main(Main.java:61)

PR comments has broken link to severity images

The plugin comment on the PR has the image of severity. The HTML of image is wrong

Note that only issues with severity &gt;=
<img alt="MAJOR" src="https://raw.githubusercontent.com/mibexsoftware/" title="sonar-bitbucket-plugin/master/src/main/resources/images/severity/MAJOR.png"> (major)
 are reported.

The whole URL is splitted into src and title, correct src attribute is

src="https://raw.githubusercontent.com/mibexsoftware/sonar-bitbucket-plugin/master/src/main/resources/images/severity/MAJOR.png"

Make accept on passing optional

Context:
We have to use OAuth of the repo owners account and the plugin accepts all pull requests when the build passes in his name. Something surely not intended. Please make a config option to let us choose if we want this feature or not.

Null Pointer Exception in fetchPage

Hello!

We are trying to use the Sonar BitBucket plugin together with Gradle, however, even though authentication seems to work, we are receiving a NPE after receiving the pull request page as a json:
06-May-2016 10:42:37 Plug-in config: [PluginConfiguration](accountName=__removed_account_name__,repoSlug=__removed_repo_slug__,teamName=__removed_account_name__,apiKey=***,oauthTokenClientKey=null,oauthTokenClientSecret=null,branchName=__removed_branch_name__,approveUnApproveEnabled=true,minSeverity=MAJOR) 06-May-2016 10:42:37 06-May-2016 10:42:37 08:42:37.785 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Post-jobs : ch.mibex.bitbucket.sonar.review.SonarReviewPostJob@66f88fd3 06-May-2016 10:42:37 08:42:37.785 [INFO] [org.sonarqube.gradle.SonarQubeTask] Executing post-job ch.mibex.bitbucket.sonar.review.SonarReviewPostJob 06-May-2016 10:42:37 08:42:37.812 [INFO] [com.sun.jersey.api.client.filter.LoggingFilter] 1 * Client out-bound request 06-May-2016 10:42:37 1 > GET https://bitbucket.org/api/2.0/repositories/__removed_account_name__/__removed_repo_slug__/pullrequests?page=1&pagelen=50&state=OPEN 06-May-2016 10:42:37 1 > Accept: application/json 06-May-2016 10:42:37 1 > Content-Type: application/json 06-May-2016 10:42:37 1 > Authorization: Basic __removed_auth_token__ 06-May-2016 10:42:37 06-May-2016 10:42:38 08:42:38.018 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@352288bc7 pairs: {GET /api/2.0/repositories/__removed_account_name__/__removed_repo_slug__/pullrequests?page=1&pagelen=50&state=OPEN HTTP/1.1: null}{Accept: application/json}{Content-Type: application/json}{Authorization: Basic __removed_auth_token__}{User-Agent: Java/1.8.0_77}{Host: bitbucket.org}{Connection: keep-alive} 06-May-2016 10:42:38 08:42:38.109 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@33acec5e18 pairs: {null: HTTP/1.1 200 OK}{Server: nginx/1.6.2}{Vary: Authorization, Cookie}{Vary: Accept-Encoding}{Content-Type: application/json; charset=utf-8}{Strict-Transport-Security: max-age=31536000}{Date: Fri, 06 May 2016 08:42:38 GMT}{X-Served-By: app-110}{ETag: "c174abbe0fb581cd28501ba4032407e0"}{X-Static-Version: cee7bfdf65a1}{X-Content-Type-Options: nosniff}{X-Accepted-OAuth-Scopes: pullrequest}{X-Render-Time: 0.0764009952545}{Connection: keep-alive}{X-Request-Count: 322}{X-Version: cee7bfdf65a1}{X-Frame-Options: SAMEORIGIN}{Content-Length: 8958} 06-May-2016 10:42:38 08:42:38.117 [INFO] [com.sun.jersey.api.client.filter.LoggingFilter] 1 * Client in-bound response 06-May-2016 10:42:38 1 < 200 06-May-2016 10:42:38 1 < X-Accepted-OAuth-Scopes: pullrequest 06-May-2016 10:42:38 1 < Server: nginx/1.6.2 06-May-2016 10:42:38 1 < X-Content-Type-Options: nosniff 06-May-2016 10:42:38 1 < Connection: keep-alive 06-May-2016 10:42:38 1 < X-Static-Version: cee7bfdf65a1 06-May-2016 10:42:38 1 < X-Version: cee7bedf65a1 06-May-2016 10:42:38 1 < Date: Fri, 06 May 2016 08:42:38 GMT 06-May-2016 10:42:38 1 < X-Frame-Options: SAMEORIGIN 06-May-2016 10:42:38 1 < Strict-Transport-Security: max-age=31536000 06-May-2016 10:42:38 1 < X-Render-Time: 0.0764009952545 06-May-2016 10:42:38 1 < ETag: "c174abbe0fb341cd28501ba4032407e0" 06-May-2016 10:42:38 1 < X-Served-By: app-110 06-May-2016 10:42:38 1 < Vary: Accept-Encoding 06-May-2016 10:42:38 1 < Vary: Authorization, Cookie 06-May-2016 10:42:38 1 < Content-Length: 8958 06-May-2016 10:42:38 1 < X-Request-Count: 322 06-May-2016 10:42:38 1 < Content-Type: application/json; charset=utf-8 06-May-2016 10:42:38 1 < 06-May-2016 10:42:38 {"pagelen": 50, "values": [{"description": "* SonarQube gradle configuration - phase 1\r\n\r\n* SonarQube gradle configuration - phase 2\r\n\r\n* try to fix an error in bamboo: \"Updated value for ... json removed for security reasons ... }, "created_on": "2016-03-18T13:14:14.419801+00:00", "reason": "", "updated_on": "2016-04-01T14:39:28.338581+00:00", "type": "pullrequest", "id": 5550, "task_count": 0}], "page": 1, "size": 3} 06-May-2016 10:42:38 06-May-2016 10:42:38 08:42:38.196 [INFO] [org.sonarqube.gradle.SonarQubeTask] Analysis report generated in /home/bamboo/bamboo-agent-home/xml-data/build-dir/__removed_repo_slug__-OT-SQ/build/sonar/batch-report 06-May-2016 10:42:38 08:42:38.201 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':sonarqube' 06-May-2016 10:42:38 08:42:38.201 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :sonarqube FAILED 06-May-2016 10:42:38 08:42:38.202 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :sonarqube (Thread[main,5,main]) completed. Took 14.42 secs. 06-May-2016 10:42:38 08:42:38.202 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 14.42 secs, idle: 0.0 secs 06-May-2016 10:42:38 08:42:38.209 [ERROR] [org.gradle.BuildExceptionReporter] 06-May-2016 10:42:38 08:42:38.210 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 06-May-2016 10:42:38 08:42:38.211 [ERROR] [org.gradle.BuildExceptionReporter] 06-May-2016 10:42:38 08:42:38.211 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 06-May-2016 10:42:38 08:42:38.211 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':sonarqube'. 06-May-2016 10:42:38 08:42:38.211 [ERROR] [org.gradle.BuildExceptionReporter] > java.lang.NullPointerException (no error message) 06-May-2016 10:42:38 08:42:38.212 [ERROR] [org.gradle.BuildExceptionReporter] 06-May-2016 10:42:38 08:42:38.212 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is: 06-May-2016 10:42:38 08:42:38.213 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarqube'. 06-May-2016 10:42:38 08:42:38.213 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) 06-May-2016 10:42:38 08:42:38.213 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) 06-May-2016 10:42:38 08:42:38.214 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) 06-May-2016 10:42:38 08:42:38.214 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64) 06-May-2016 10:42:38 08:42:38.214 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) 06-May-2016 10:42:38 08:42:38.214 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52) 06-May-2016 10:42:38 08:42:38.214 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) 06-May-2016 10:42:38 08:42:38.214 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) 06-May-2016 10:42:38 08:42:38.215 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 06-May-2016 10:42:38 08:42:38.215 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203) 06-May-2016 10:42:38 08:42:38.215 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185) 06-May-2016 10:42:38 08:42:38.215 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:62) 06-May-2016 10:42:38 08:42:38.215 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50) 06-May-2016 10:42:38 08:42:38.215 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25) 06-May-2016 10:42:38 08:42:38.215 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110) 06-May-2016 10:42:38 08:42:38.216 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) 06-May-2016 10:42:38 08:42:38.216 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 06-May-2016 10:42:38 08:42:38.216 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23) 06-May-2016 10:42:38 08:42:38.216 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43) 06-May-2016 10:42:38 08:42:38.216 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 06-May-2016 10:42:38 08:42:38.216 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 06-May-2016 10:42:38 08:42:38.216 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) 06-May-2016 10:42:38 08:42:38.217 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154) 06-May-2016 10:42:38 08:42:38.217 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Factories$1.create(Factories.java:22) 06-May-2016 10:42:38 08:42:38.217 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) 06-May-2016 10:42:38 08:42:38.217 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52) 06-May-2016 10:42:38 08:42:38.217 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151) 06-May-2016 10:42:38 08:42:38.217 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32) 06-May-2016 10:42:38 08:42:38.217 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99) 06-May-2016 10:42:38 08:42:38.218 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93) 06-May-2016 10:42:38 08:42:38.218 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) 06-May-2016 10:42:38 08:42:38.218 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62) 06-May-2016 10:42:38 08:42:38.218 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93) 06-May-2016 10:42:38 08:42:38.218 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82) 06-May-2016 10:42:38 08:42:38.218 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94) 06-May-2016 10:42:38 08:42:38.218 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) 06-May-2016 10:42:38 08:42:38.219 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) 06-May-2016 10:42:38 08:42:38.219 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43) 06-May-2016 10:42:38 08:42:38.219 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) 06-May-2016 10:42:38 08:42:38.219 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:77) 06-May-2016 10:42:38 08:42:38.219 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:47) 06-May-2016 10:42:38 08:42:38.219 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51) 06-May-2016 10:42:38 08:42:38.219 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28) 06-May-2016 10:42:38 08:42:38.220 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43) 06-May-2016 10:42:38 08:42:38.220 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170) 06-May-2016 10:42:38 08:42:38.220 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237) 06-May-2016 10:42:38 08:42:38.220 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210) 06-May-2016 10:42:38 08:42:38.220 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35) 06-May-2016 10:42:38 08:42:38.220 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) 06-May-2016 10:42:38 08:42:38.220 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206) 06-May-2016 10:42:38 08:42:38.221 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169) 06-May-2016 10:42:38 08:42:38.221 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) 06-May-2016 10:42:38 08:42:38.221 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) 06-May-2016 10:42:38 08:42:38.221 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:33) 06-May-2016 10:42:38 08:42:38.221 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) 06-May-2016 10:42:38 08:42:38.221 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54) 06-May-2016 10:42:38 08:42:38.221 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) 06-May-2016 10:42:38 08:42:38.221 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:23) 06-May-2016 10:42:38 08:42:38.222 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) 06-May-2016 10:42:38 08:42:38.222 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) 06-May-2016 10:42:38 08:42:38.222 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56) 06-May-2016 10:42:38 08:42:38.222 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NullPointerException 06-May-2016 10:42:38 08:42:38.222 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1$$anonfun$apply$1.apply(BitbucketClient.scala:62) 06-May-2016 10:42:38 08:42:38.222 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1$$anonfun$apply$1.apply(BitbucketClient.scala:57) 06-May-2016 10:42:38 08:42:38.222 [ERROR] [org.gradle.BuildExceptionReporter] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245) 06-May-2016 10:42:38 08:42:38.223 [ERROR] [org.gradle.BuildExceptionReporter] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245) 06-May-2016 10:42:38 08:42:38.223 [ERROR] [org.gradle.BuildExceptionReporter] at scala.collection.immutable.List.foreach(List.scala:381) 06-May-2016 10:42:38 08:42:38.223 [ERROR] [org.gradle.BuildExceptionReporter] at scala.collection.TraversableLike$class.map(TraversableLike.scala:245) 06-May-2016 10:42:38 08:42:38.223 [ERROR] [org.gradle.BuildExceptionReporter] at scala.collection.immutable.List.map(List.scala:285) 06-May-2016 10:42:38 08:42:38.223 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1.apply(BitbucketClient.scala:57) 06-May-2016 10:42:38 08:42:38.223 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1.apply(BitbucketClient.scala:56) 06-May-2016 10:42:38 08:42:38.223 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.client.BitbucketClient.fetchPage(BitbucketClient.scala:212) 06-May-2016 10:42:38 08:42:38.223 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.client.BitbucketClient.ch$mibex$bitbucket$sonar$client$BitbucketClient$$fetchPullRequestsPage$1(BitbucketClient.scala:55) 06-May-2016 10:42:38 08:42:38.224 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$findPullRequestsWithSourceBranch$1.apply(BitbucketClient.scala:72) 06-May-2016 10:42:38 08:42:38.224 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$findPullRequestsWithSourceBranch$1.apply(BitbucketClient.scala:71) 06-May-2016 10:42:38 08:42:38.224 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.client.BitbucketClient.forEachResultPage(BitbucketClient.scala:219) 06-May-2016 10:42:38 08:42:38.224 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.client.BitbucketClient.findPullRequestsWithSourceBranch(BitbucketClient.scala:71) 06-May-2016 10:42:38 08:42:38.224 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.findPullRequestsForConfiguredBranch(SonarReviewPostJob.scala:36) 06-May-2016 10:42:38 08:42:38.224 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.executeOn(SonarReviewPostJob.scala:18) 06-May-2016 10:42:38 08:42:38.224 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:65) 06-May-2016 10:42:38 08:42:38.225 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55) 06-May-2016 10:42:38 08:42:38.225 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:87) 06-May-2016 10:42:38 08:42:38.225 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:189) 06-May-2016 10:42:38 08:42:38.225 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) 06-May-2016 10:42:38 08:42:38.225 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) 06-May-2016 10:42:38 08:42:38.225 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:265) 06-May-2016 10:42:38 08:42:38.225 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:260) 06-May-2016 10:42:38 08:42:38.225 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:250) 06-May-2016 10:42:38 08:42:38.226 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) 06-May-2016 10:42:38 08:42:38.226 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.scan.ProjectScanContainer.startComponents(ProjectScanContainer.java:128) 06-May-2016 10:42:38 08:42:38.226 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) 06-May-2016 10:42:38 08:42:38.226 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55) 06-May-2016 10:42:38 08:42:38.226 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86) 06-May-2016 10:42:38 08:42:38.226 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) 06-May-2016 10:42:38 08:42:38.229 [LIFECYCLE] [org.gradle.BuildResultLogger] 06-May-2016 10:42:38 08:42:38.229 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED 06-May-2016 10:42:38 08:42:38.229 [LIFECYCLE] [org.gradle.BuildResultLogger] 06-May-2016 10:42:38 08:42:38.229 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 20.543 secs 06-May-2016 10:42:38 08:42:38.226 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) 06-May-2016 10:42:38 08:42:38.227 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:124) 06-May-2016 10:42:38 08:42:38.227 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119) 06-May-2016 10:42:38 08:42:38.227 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62) 06-May-2016 10:42:38 08:42:38.227 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) 06-May-2016 10:42:38 08:42:38.227 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.proxy.$Proxy51.execute(Unknown Source) 06-May-2016 10:42:38 08:42:38.227 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240) 06-May-2016 10:42:38 08:42:38.227 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151) 06-May-2016 10:42:38 08:42:38.227 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonarqube.gradle.SonarQubeTask.run(SonarQubeTask.java:84) 06-May-2016 10:42:38 08:42:38.228 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) 06-May-2016 10:42:38 08:42:38.228 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227) 06-May-2016 10:42:38 08:42:38.228 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220) 06-May-2016 10:42:38 08:42:38.228 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209) 06-May-2016 10:42:38 08:42:38.228 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585) 06-May-2016 10:42:38 08:42:38.228 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568) 06-May-2016 10:42:38 08:42:38.228 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) 06-May-2016 10:42:38 08:42:38.228 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) 06-May-2016 10:42:38 08:42:38.229 [ERROR] [org.gradle.BuildExceptionReporter] ... 60 more 06-May-2016 10:42:38 08:42:38.229 [ERROR] [org.gradle.BuildExceptionReporter]

Please note that some information has been redacted for security reasons. Also, the JSON we receive is correct, contains the pull requests, and has been validated so the auth is working fine.

The way we call this plugin is through gradle:
./gradlew sonarqube -x test --stacktrace \ -Dsonar.projectVersion=${bamboo.repository.branch.name} \ -Dsonar.analysis.mode=issues \ -Dsonar.bitbucket.repoSlug=__removed_repo_slug__ \ -Dsonar.bitbucket.accountName=__removed_account_name \ -Dsonar.bitbucket.teamName=__removed_team_name__ \ -Dsonar.bitbucket.apiKey=__removed_api_key__ \ -Dsonar.bitbucket.branchName=${bamboo.repository.git.branch} \ -Dsonar.host.url=http://sonar_url:9000/ \ -Dsonar.login=admin \ -Dsonar.password=sonar_password \ -Dsonar.analysis.mode=issues \ -Dsonar.verbose=true

Is this something we can fix, or a bug in the plugin?

Thank you!

Issues not commented on when line numbers don't match exactly

While I assume it's intended behaviour that SonarQube's reported line number for a new issue must fall within the Git diff for the plugin to comment on it, I wanted to point out at least one example where this can cause a newly introduced issue to be ignored by the plugin.

If I have existing Java code with a try-catch like so:

try {
    // something
} catch (SomeException e) {
    throw new RuntimeException(e);
}

And then delete the throw ... line, Sonar will report a new issue on line 3 (which makes sense), whereas the Git diff shows line 4 as the line that changes (which also makes sense of course). I imagine there are other types of issue that are similar.

I think it would be nice to be able to force the plugin to add comments for all new issues in modified files, rather than just all new issues in modified files that match modified line numbers. Perhaps another configuration property could be added to support this. While this could conceivably result in comments being invisible in the PR because they are associated with line numbers that are far away from any actual diffs (though in the above example, and probably the vast majority of cases, that wouldn't be a problem), at least the comments would be there, and the global comment would show that there are outstanding issues.

Enable/Disable Plugin

Is it possible to enable/disable the plugin? I don't want to use it for every sonar run and not for every project.

plugin does not report issues

Hi,

I have created a test dummy project that has the following sonar issue:
screen shot 2015-11-15 at 08 05 39

The corresponding pull request is:
screen shot 2015-11-15 at 08 07 31

when I run the plugin though it says
screen shot 2015-11-15 at 08 10 51

The plugin run does not report does not fail

[INFO] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/org.test:sonar-bitbucket-test
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report.
[INFO] More about the report processing at http://localhost:9000/api/ce/task?id=AVEJ-nU-ftLrHmvwhbVR
[INFO] Executing post-job ch.mibex.bitbucket.sonar.review.SonarReviewPostJob
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.753 s
[INFO] Finished at: 2015-11-15T08:09:53+01:00
[INFO] Final Memory: 43M/538M
[INFO] ------------------------------------------------------------------------

why is the issue not reported in the pull request ?

Parse git diff fails for some pull requests

Exception Failed to parse git diff: string matching regex '\z' expected but \n found is thrown for one of my pull requests. This consistently happens every time whereas another relatively very small pull request succeeds.

Let me know if the full bitbucket diff would be useful.

Here is the stack trace:

org.sonar.runner.impl.RunnerException: Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91) at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) at java.security.AccessController.doPrivileged(Native Method) at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) INFO: ------------------------------------------------------------------------ at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) at org.sonar.runner.api.Runner.execute(Runner.java:100) at org.sonar.runner.Main.executeTask(Main.java:70) at org.sonar.runner.Main.execute(Main.java:59) at org.sonar.runner.Main.main(Main.java:53) Caused by: java.lang.RuntimeException: [sonar4bitbucket] Failed to parse git diff: string matching regex\z' expected but ' found at ch.mibex.bitbucket.sonar.diff.IssuesOnChangedLinesFilter.parseOrFail(IssuesOnChangedLinesFilter.scala:48) at ch.mibex.bitbucket.sonar.diff.IssuesOnChangedLinesFilter.filter(IssuesOnChangedLinesFilter.scala:19) at ch.mibex.bitbucket.sonar.review.ReviewCommentsCreator.processIssues(ReviewCommentsCreator.scala:74) at ch.mibex.bitbucket.sonar.review.ReviewCommentsCreator.createOrUpdateComments(ReviewCommentsCreator.scala:28) at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob$$anonfun$executeOn$1.apply(SonarReviewPostJob.scala:21) at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob$$anonfun$executeOn$1.apply(SonarReviewPostJob.scala:18) at scala.collection.immutable.List.foreach(List.scala:381) at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.executeOn(SonarReviewPostJob.scala:18) at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:65) at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55) at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:107) at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85) at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:258) at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:253) at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85) at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153) at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76) at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87) ... 9 more ERROR: ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging. The sonar-runner did not complete successfully

POM file for a PHP project

Hi,

I want to use the sonar bitbucket plugin for analyzing a PHP project.
I'm not very familiar with Maven but when Jenkins run mvn command with the supplied arguments it complains for POM file.

"The goal you specified requires a project to execute but there is no POM in this directory"

I read the POM basics from Maven website but I'm not sure what to set for "packaging" when I don't package my project.

Can you give me a hint how to run sonar for PHP project?

Non-maven PHP project hosted on bitbucket

Hello,

This might not be an issue but quick question about the plugin. I have a PHP project which is not based on maven, hosted on bitbucket. I do have jenkins job which is building this php project. I have integrated this plugin's config "mvn clean" before build on the job. I do have maven and sonarqube 5.6 configured correctly.

Here is the error:
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory

Thanks!

Issues found on existing files not generating comments on PR

Hi, I'm experiencing following issue: pull request for new branch is created, one class is added with some bad code (that will surely trigger MAJOR issue) and in one already existing file, one line of code was added, that should trigger issue.
In this scenario, I'm not getting comment for issue on existing file, but just comment for issues found on new file.
Here's snippet of log file (referencing this part where problem is actually found).

diff --git a//src/main/java/com/-/sharedstep/DocumentDownloader.java b//src/main/java/com/-/sharedstep/DocumentDownloader.java
index f12be01..f7859d4 100644
--- a//-/src/main/java/com/-/sharedstep/DocumentDownloader.java
+++ b/
/-/src/main/java/com/-/sharedstep/DocumentDownloader.java
@@ -12,0 +13 @@ public class DocumentDownloader implements IDocumentDownloader {

  • private List listOfStrings;

08:53:53.831 DEBUG: [sonar4bitbucket] Found 1 issues and 1 of them are new:
08:53:53.831 DEBUG: [sonar4bitbucket] - com.*****.-:-src/main/java/com/-/sharedstep/DocumentDownloader.java:1: Unused field: com.-.sharedstep.DocumentDownloader.listOfStrings
08:53:53.831 DEBUG: [sonar4bitbucket] And 0 of these are on changed or new lines:
08:53:53.831 DEBUG: [sonar4bitbucket] Found 0 existing inline comments:
Jun 06, 2017 8:53:53 AM com.sun.jersey.api.client.filter.LoggingFilter log
INFO: 8 * Client out-bound request
8 > DELETE https://bitbucket.org/api/1.0/repositories/********/121/comments/###
8 > Authorization: Bearer ************

Do you have any suggestion, @mrueegg ?
If you need any more info, please let me know.

Thanks!

Comments were not added to the new file!

Hi,

When the pull request have a brand new file, the pulg-in is identifying the issues, the comments were not visible with the file. Instead the comments can be seen the activity tab of the bitbucket with the this message:

"commented on a file but no context is available"

screen shot 2016-03-14 at 1 58 46 pm

Plugin fails to run in Jenkins

Hello,

we have the problem that the plugin stopped working today out of nowhere in our Jenkins build. The stacktrace is as follows:
ERROR: Error during SonarQube Scanner execution
java.lang.NullPointerException
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1$$anonfun$apply$1.apply(BitbucketClient.scala:62)
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1$$anonfun$apply$1.apply(BitbucketClient.scala:57)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
at scala.collection.immutable.List.map(List.scala:285)
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1.apply(BitbucketClient.scala:57)
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$1.apply(BitbucketClient.scala:56)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.fetchPage(BitbucketClient.scala:212)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.ch$mibex$bitbucket$sonar$client$BitbucketClient$$fetchPullRequestsPage$1(BitbucketClient.scala:55)
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$findPullRequestsWithSourceBranch$1.apply(BitbucketClient.scala:72)
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$findPullRequestsWithSourceBranch$1.apply(BitbucketClient.scala:71)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.forEachResultPage(BitbucketClient.scala:219)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.findPullRequestsWithSourceBranch(BitbucketClient.scala:71)
at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.findPullRequestsForConfiguredBranch(SonarReviewPostJob.scala:36)
at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.executeOn(SonarReviewPostJob.scala:18)
at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:65)
at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:107)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:274)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:165)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:152)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:133)
at org.sonarsource.scanner.cli.Main.execute(Main.java:82)
at org.sonarsource.scanner.cli.Main.main(Main.java:66)

I saw that you recommended to Query the Bitbucket REST API which gave us the following result:
...,
"destination": {
"commit": {
"hash": "aeee8fe7f208",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/{owner}/{repo_slug}/commit/aeee8fe7f208"
}
}
},
...
},
...

Is this issue related to #23 or is there a different problem? Any help would be much appreciated.

Sonar Crashes After Installing

When installing plugin, Sonar will start, but then very quickly shuts itself down.

Here's the log output where it's failing:

2016.11.06 11:46:48 INFO  ce[][o.s.p.ProcessEntryPoint] Starting ce
2016.11.06 11:46:48 INFO  ce[][o.s.ce.app.CeServer] Compute Engine starting up...
2016.11.06 11:46:49 INFO  ce[][o.e.plugins] [Tom Thumb] modules [], plugins [], sites []
2016.11.06 11:46:50 INFO  ce[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2016.11.06 11:46:50 INFO  ce[][o.sonar.db.Database] Create JDBC data source for jdbc:mysql://localhost:3306/sonarqube?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
2016.11.06 11:46:52 INFO  ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /etc/sonarqube
2016.11.06 11:46:52 INFO  ce[][o.s.c.c.CePluginRepository] Load plugins
2016.11.06 11:46:53 ERROR ce[][o.s.ce.app.CeServer] Compute Engine startup failed
java.lang.IllegalStateException: Can not extract sonar-plugin-api-deps.jar to /etc/sonarqube/temp/tmp/sonar-plugin-api-deps3150398346094117636jar
	at org.sonar.core.platform.PluginClassloaderFactory.extractCompatibilityModeJar(PluginClassloaderFactory.java:134) ~[sonar-core-6.1.jar:na]
	at org.sonar.core.platform.PluginClassloaderFactory.create(PluginClassloaderFactory.java:86) ~[sonar-core-6.1.jar:na]
	at org.sonar.core.platform.PluginLoader.load(PluginLoader.java:72) ~[sonar-core-6.1.jar:na]
	at org.sonar.ce.container.CePluginRepository.start(CePluginRepository.java:71) ~[sonar-ce-6.1.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_60]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_60]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_60]
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.15.jar:na]
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.15.jar:na]
	at org.sonar.core.platform.ComponentContainer$1.start(ComponentContainer.java:320) ~[sonar-core-6.1.jar:na]
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.15.jar:n2016.11.06 11:46:54 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(Unknown Source)
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
2016.11.06 11:46:54 INFO  web[][o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.11.06 11:46:55 WARN   es[][o.e.c.r.a.decider]  [sonarqube] high disk watermark [90%] exceeded on [hjAqbvqFR9qgM4Yl-V5PIw][sonarqube][/etc/sonarqube/data/es/sonarqube/nodes/0] free: 29.7mb[1.5%], shards will be relocated away from this node
2016.11.06 11:46:55 INFO   es[][o.e.c.r.a.decider]  [sonarqube] rerouting shards: [high disk watermark exceeded on one or more nodes]
2016.11.06 11:46:55 INFO  web[][o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.11.06 11:46:55 INFO  web[][o.s.s.a.TomcatAccessLog] Web server is stopped
2016.11.06 11:46:56 INFO  app[][o.s.p.m.Monitor] Process[web] is stopped
2016.11.06 11:46:56 INFO  app[][o.s.p.m.Monitor] Process[es] is stopping
2016.11.06 11:46:56 INFO   es[][o.s.p.StopWatcher]  Stopping process
2016.11.06 11:46:56 INFO   es[][o.elasticsearch.node]  [sonarqube] stopping ...
2016.11.06 11:46:56 INFO   es[][o.elasticsearch.node]  [sonarqube] stopped
2016.11.06 11:46:56 INFO   es[][o.elasticsearch.node]  [sonarqube] closing ...
2016.11.06 11:46:56 INFO   es[][o.elasticsearch.node]  [sonarqube] closed
2016.11.06 11:46:57 INFO  app[][o.s.p.m.Monitor] Process[es] is stopped
<-- Wrapper Stopped

Only way to resolve was to remove sonar-bitbucket-plugin-1.1.5.jar from the plugin extensions.

Plugin not working as Bitbucket URL is incorrect

Plugin not working as Bitbucket URL is incorrect. In many places in the plugin code, the plugin tries to connect to the bitbucket server and uses the token "pullrequests" as part of the URL. e.g https://bitbucket.org///pullrequests? params

But in the version of the cloud bitbucket that I am using, it is not "pullrequests", but instead "pull-requests" (with the hyphen).

Hence, the operations are failing to find the required resource.

Publishing fails after adding sonar-bitbuckit-plugin

Actual Behavior

I'm using Jenkins pipeline to automatically build our Android apps. Depending on the branch, the Sonarqube phase of this build process should either publish the analysis to our Sonarqube site (for builds on develop) or add comments on the pull request (for builds on PR branches).

The publishing was working fine using the Sonarqube gradle plugin: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Gradle
I simply used the "./gradlew sonarqube" command to publish the results.

After adding the sonar-bitbucket-plugin to our Sonarqube I can see comments on the Bitbucket pull requests, but the publishing (for develop builds) now fails with the following error message in the logs:

20:25:57.780 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.lang.IllegalArgumentException: requirement failed: [sonar4bitbucket] The plug-in only works in preview or issues mode. Please set "-Dsonar.analysis.mode" accordingly.

After removing the sonar-bitbucket-plugin again, publishing again works as expected.

It seems that the "./gradlew sonarqube" command now triggers the sonar-bitbucket-plugin (which we don't need on develop builds) instead of just publishing to Sonarqube with the SonarQube Scanner for Gradle.

Expected Behavior

I would like to use both Sonarqube publishing or commenting (though not at the same time) in my automated builds. Is there a way to do this? Am I using the Scanner of bitbucket-plugin incorrectly?

Plug-in version, SonarQube version, CI system, build type

sonar-bitbucket-plugin 1.2.0
Sonarqube 6.0
Jenkins 2.46.3, using pipeline builds

Duplicated code-level comments using OAuth

I see code in ReviewCommentsCreator that looks like this plugin should be updating / deleting old code-level comments as long as they are on the same line and have matching text. However, when I trigger the SonarQube analysis, the plugin keeps adding duplicated comments on the same lines as its previous comments.

Note we're using OAuth and not a team account & API key. When I use an API key there are no duplicated entries.

Not finding open pull requests on a branch

Hi,
I'm trying to get sonar-bitbucket-plugin to analyse multiple branch pull request.
But it always says:
[INFO] [sonar4bitbucket] No open pull requests with source branch 'releases/4B' found. No analysis will be performed.

But as you can see on my bitbucket repo I have pull request on that specific branch (releases/4B)
screen shot 2016-12-04 at 01 37 53

I've also checked on the received json and the pull request are coming with the correct branch
I'm using:
-Dsonar.branch=${branch}

Can you please help me?
Thanks

Adding comments on every maven build

Hi, I've been trying to use your plugin.
I'm seeing that every time I run the maven build the same comments are being added.
I'm also seeing that no issues are being found on the pull request, but if I go to the sonar and open those class files, they have issue. Are this only analyzing the new/modified lines?

Thanks

Exception while checking PR

or 01-Feb-2016 11:05:42 11:05:42.121 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.RuntimeException: [sonar4bitbucket] Failed to parse git diff: index ' expected but d' found error 01-Feb-2016 11:05:42 11:05:42.121 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.diff.IssuesOnChangedLinesFilter.parseOrFail(IssuesOnChangedLinesFilter.scala:48) error 01-Feb-2016 11:05:42 11:05:42.122 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.diff.IssuesOnChangedLinesFilter.filter(IssuesOnChangedLinesFilter.scala:19) error 01-Feb-2016 11:05:42 11:05:42.122 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.review.ReviewCommentsCreator.processIssues(ReviewCommentsCreator.scala:76) error 01-Feb-2016 11:05:42 11:05:42.122 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.review.ReviewCommentsCreator.createOrUpdateComments(ReviewCommentsCreator.scala:30) error 01-Feb-2016 11:05:42 11:05:42.122 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob$$anonfun$executeOn$1.apply(SonarReviewPostJob.scala:21) error 01-Feb-2016 11:05:42 11:05:42.122 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob$$anonfun$executeOn$1.apply(SonarReviewPostJob.scala:18) error 01-Feb-2016 11:05:42 11:05:42.122 [ERROR] [org.gradle.BuildExceptionReporter] at scala.collection.immutable.List.foreach(List.scala:381) error 01-Feb-2016 11:05:42 11:05:42.125 [ERROR] [org.gradle.BuildExceptionReporter] at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.executeOn(SonarReviewPostJob.scala:18) error 01-Feb-2016 11:05:42 11:05:42.125 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:65) error 01-Feb-2016 11:05:42 11:05:42.126 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55) error 01-Feb-2016 11:05:42 11:05:42.126 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:107) error 01-Feb-2016 11:05:42 11:05:42.126 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185) error 01-Feb-2016 11:05:42 11:05:42.126 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132) error 01-Feb-2016 11:05:42 11:05:42.126 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117) error 01-Feb-2016 11:05:42 11:05:42.126 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243) error 01-Feb-2016 11:05:42 11:05:42.126 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238) error 01-Feb-2016 11:05:42 11:05:42.127 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228) error 01-Feb-2016 11:05:42 11:05:42.127 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132) error 01-Feb-2016 11:05:42 11:05:42.127 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117) error 01-Feb-2016 11:05:42 11:05:42.127 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55) error 01-Feb-2016 11:05:42 11:05:42.127 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86) error 01-Feb-2016 11:05:42 11:05:42.127 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132) error 01-Feb-2016 11:05:42 11:05:42.127 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117) error 01-Feb-2016 11:05:42 11:05:42.127 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122) error 01-Feb-2016 11:05:42 11:05:42.127 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:67) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.proxy.$Proxy57.execute(Unknown Source) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:274) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:165) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:152) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonarqube.gradle.SonarQubeTask.run(SonarQubeTask.java:84) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568) error 01-Feb-2016 11:05:42 11:05:42.128 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) error 01-Feb-2016 11:05:42 11:05:42.129 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)

Not able to analyze a PR from fork to main repo

Expected Behavior

We are experiencing issues with bitbucket cloud integration when analyzing Pull Requests from a forked repo into the main repo. Is there any way to configure the accountName for the source and target independently?

I tried to include only the relevant info in the log. Let me know if any other info is needed to provide a solution.

Actual Behavior

Assume we have a main repo called upstream and a fork called origin.

Running the sonar-runner with account name origin and PR 7375 results in the following error.
> sonar-runner -Dsonar.bitbucket.accountName=origin -Dsonar.bitbucket.pullRequestId=7375 -Dsonar.analysis.mode=issues...

18:53:50.746 DEBUG - Post-jobs : Sonar Plug-in for Bitbucket Cloud (wrapped)
18:53:50.746 INFO  - Executing post-job Sonar Plug-in for Bitbucket Cloud (wrapped)
18:53:50.899 INFO  - [sonar4bitbucket] Pull request with id '7375' not found. No analysis will be performed.

This makes sense since the PR is listed in the upsteam repo.

Running the sonar-runner with account name upstream and PR 7375 results in the following error.
> sonar-runner -Dsonar.bitbucket.accountName=upstream -Dsonar.bitbucket.pullRequestId=7375 -Dsonar.analysis.mode=issues ...

18:56:04.369 DEBUG - Post-jobs : Sonar Plug-in for Bitbucket Cloud (wrapped)
18:56:04.369 INFO  - Executing post-job Sonar Plug-in for Bitbucket Cloud (wrapped)
18:56:04.652 INFO  - [sonar4bitbucket] Plug-in is active and will analyze pull request with #7375...
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 47.238s
Final Memory: 31M/1139M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: POST https://bitbucket.org/api/2.0/repositories/upstream/****/commit/fabac8a20182/statuses/build returned a response status of 404 Not Found
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

This also makes sense since the commit of the PR is not yet merged into upstream. Is there any way to configure the accountName for the source and target independently?

Plug-in version, SonarQube version, CI system, build type

Sonarqube 5.6
Bitbucket for Sonar 1.2.0

Plugins fails with "No access token found" message

Hi,

sorry if this is trivial, this is my first try with the plugin (also oauth).

I create a bitbucket repository and wanted to run the plugin on it.

My command is

mvn clean verify sonar:sonar --batch-mode --errors -Dsonar.bitbucket.repoSlug=sonar-pull-request-plugin-test -Dsonar.bitbucket.accountName=username -Dsonar.bitbucket.oauthClientKey=key -Dsonar.bitbucket.oauthClientSecret=secret -Dsonar.bitbucket.branchName=master -Dsonar.analysis=issues

this fails with

Caused by: java.lang.IllegalStateException: No access token found
at ch.mibex.bitbucket.sonar.client.ClientAuthentication.ch$mibex$bitbucket$sonar$client$ClientAuthentication$$createOauthAccessToken(AuthenticationFilter.scala:94)
at ch.mibex.bitbucket.sonar.client.ClientAuthentication$$anon$1.(AuthenticationFilter.scala:65)
at ch.mibex.bitbucket.sonar.client.ClientAuthentication.configure(AuthenticationFilter.scala:64)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.createJerseyClient(BitbucketClient.scala:34)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.(BitbucketClient.scala:26)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)
[....]
... 23 more

what I did

  1. on bitbucket i went "Manage Account" -> "OAuth" -> "Add consumer"
  2. gave it an arbitrary name, some description and no callback URL nor URL (didn't know what to enter there).
  3. Permissions set to "Repositories" "Write" and "Pull requests" "Write"
  4. entered the given key as sonar.bitbucket.oauthClientKey and the secret as onar.bitbucket.oauthClientSecret

I'm not sure what you mean with

the client key of the OAuth consumer created for this application here

how can I create one for this application ? I can only create an arbitrary it seems.

Thanks for help - and sorry if this is not actually an issue of the project, i dont know another way to request this.

No open pull requests with source branch 'development' found. No analysis will be performed.

Expected Behavior

We've setup sonarqube with the bitbucket plugin for bitbucket pipelines. Before adding the bitbucket plugin it used to run SonarQube and the results for every branch were visible on our sonar server.

Actual Behavior

We've noticed now that since adding the bitbucket plugin the results of the scans against development branch (and any other branch without a PR) are not saved. The log line is:

INFO: [sonar4bitbucket] No open pull requests with source branch 'development' found. No analysis will be performed.

Is it possible to force sonar to check this even though there isn't a pull request open for that branch? We still want the results for our main branch to show in our sonar servers results.

Does it work with sonar-scanner too?

I was wondering whether this plugin needs to be installed on the sonarqube server, or whether it would also work locally with sonar-scanner.

As you are using sonar-runner -Dsonar.analysis.mode=issues ... on the server, I was wondering if you couldn't use sonar-scanner -Dsonar.analysis.mode=preview ... on a CI build node too.

When doing local analysis using sonar-scanner -Dsonar.analysis.mode=preview ... (i.e. without uploading results to the sonarqube server), I'm wondering why this plugin needs to be installed on the sonarqube server?

Unable to load component class ch.mibex.bitbucket.sonar.client.BitbucketClient

Automated code review during the pull request in Bitbucket cloud

Steps we followed for Bitbucket

  1.  We have configured Bitbucket cloud account with public/private repository.
    
  2.  We have created the "sonar.json" in the root folder of the master branch of the Bitbucket repository
    

Sonar.json

{

"sonarHost": "http://10.237.230.110:9000",

"sonarProjectKey": "gwproject"

}

  1.  Added sample java file in the root folder of the master branch
    
  2.  Installed Sonar for Bitbucket Cloud in Bitbucket
    
  3. Checked out files from master branch to C:\Users\515995\Documents\bitbucketpocTest.
    

Steps we followed for SonarQube

a. In D:\sonar\sonarqube-6.4\sonarqube-6.4\extensions\plugins folder, we have added the plugin as “sonar-bitbucket-plugin-1.2.0“

b. Sonarqube running instance url as’ http://10.237.230.110:9000” with “admin” as a username and password

c.

Steps for sonar-scanner-2.6.1

            We have configured the below properties in Sonar-Scannar properties

sonar.projectKey=gwproject

sonar.projectName=gwprojectn

sonar.projectVersion=1.0

sonar.sources=.

sonar.login=admin

sonar.password=admin

sonar.host.url=http://10.237.230.110:9000

sonar.sourceEncoding=UTF-8

Client OATH Key

  1.  We have generated OAuth Client Key and OAuth Client Secret key for my personal account.
    
  2.  If I go with OAuth, I have configured a callback URL and use the Bitbucket permissions "Repository write" and "Pull requests write" (for commenting on the pull request) as well as "Account read" for the new OAuth consumer. During OAuth creation, we have given the below information. 10.237.230.110 is my local machine IP.
    

a. CallBack Url: http://10.237.230.110:9000

b. This is a private consumer check box is unchecked

I have run the below command and found the following errors

Command

C:\Users\515995\Documents\bitbucketpocTest>sonar-scanner -Dsonar.analysis.mode=i

ssues -Dsonar.bitbucket.accountName=selvakumarsvga -Dsonar.bitbucket.repoSlug=bi

tbucketpoc -Dsonar.bitbucket.branchName=master -Dsonar.host.url=http://10.237.2

30.110:9000 -Dsonar.login=admin -Dsonar.password=admin -Dsonar.bitbucket.oauthCl

ientKey=UmDwuKEZSQGMf8f85B -Dsonar.bitbucket.oauthClientSecret=7F4jhRK4LXjNyU2m4

Gz6DPWhbNXSSNGw

Errors:

INFO: JavaClasspath initialization

WARN: Bytecode of dependencies was not provided for analysis of source files, yo

u might end up with less precise results. Bytecode can be provided using sonar.j

ava.libraries property

INFO: JavaClasspath initialization (done) | time=4ms

INFO: JavaTestClasspath initialization

INFO: JavaTestClasspath initialization (done) | time=1ms

INFO: Java Main Files AST scan

INFO: 1 source files to be analyzed

INFO: Java Main Files AST scan (done) | time=1352ms

INFO: Java Test Files AST scan

INFO: 1/1 source files have been analyzed

INFO: 0 source files to be analyzed

INFO: Java Test Files AST scan (done) | time=9ms

INFO: 0/0 source files have been analyzed

INFO: Sensor JavaSquidSensor [java] (done) | time=2310ms

INFO: Sensor SurefireSensor [java]

INFO: parsing C:\Users\515995\Documents\bitbucketpocTest\target\surefire-reports

INFO: Sensor SurefireSensor [java] (done) | time=2ms

INFO: Sensor JaCoCoSensor [java]

INFO: Sensor JaCoCoSensor [java] (done) | time=4ms

INFO: Sensor SonarJavaXmlFileSensor [java]

INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=1ms

INFO: Sensor Analyzer for "php.ini" files [php]

INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=25ms

INFO: Sensor Compute size of file names [gosu]

INFO: Sensor Compute size of file names [gosu] (done) | time=1ms

INFO: Load server issues

INFO: Load server issues (done) | time=44ms

INFO: Performing issue tracking

INFO: 5/5 components tracked

INFO: ANALYSIS SUCCESSFUL

INFO: ------------------------------------------------------------------------

INFO: EXECUTION FAILURE

INFO: ------------------------------------------------------------------------

INFO: Total time: 8.909s

INFO: Final Memory: 43M/104M

INFO: ------------------------------------------------------------------------

ERROR: Error during SonarQube Scanner execution

ERROR: Unable to load component class ch.mibex.bitbucket.sonar.client.BitbucketC

lient

ERROR: Caused by: Unable to load component class ch.mibex.bitbucket.sonar.client

.BitbucketClient

ERROR: Caused by: java.net.ConnectException: Connection refused: connect

ERROR: Caused by: Connection refused: connect

ERROR:

ERROR: To see the full stack trace of the errors, re-run SonarQube Scanner with

the -e switch.

ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging

Questions

  1. Make sure we can run the above command and any directory right?
    
  2. During the pull the request, kindly let me know if any configuration step missing
    
  3. Kindly suggest me, is there any proxy setup is needed from my local environment to Bitbucket HTTPS connection?
    
  4. I could able to find the success of analyzes and try to send the report to the bitbucket as a post request, we are getting the above errors.
    

Use behind proxy

I'm not sure if I haven't configured something poorly, in doubt I'm adding this issue (it can be added to the documentation if it's a configuration issue)

I've configured my proxy in sonar and in maven settings but keep hitting a timeout. Do you have an idea about what I could have done wrong ?

You can find the stack trace below below :

[DEBUG] [sonar4bitbucket] 
Plug-in config: [PluginConfiguration](accountName=pocsonar,repoSlug=poc-sonar,teamName=pocsonar,apiKey=***,oauthTokenClientKey=null,oauthTokenClientSecret=null,branchName=my-branch,approveUnApproveEnabled=true,minSeverity=MAJOR)

[DEBUG] Post-jobs : ch.mibex.bitbucket.sonar.review.SonarReviewPostJob@54366a54
[INFO] Executing post-job ch.mibex.bitbucket.sonar.review.SonarReviewPostJob
mai 11, 2016 1:41:33 PM com.sun.jersey.api.client.filter.LoggingFilter log
INFO: 1 * Client out-bound request
1 > GET https://bitbucket.org/api/2.0/repositories/pocsonar/poc-sonar/pullrequests?page=1&pagelen=50&state=OPEN
1 > Accept: application/json
1 > Content-Type: application/json
1 > Authorization: Basic cG9jc29uYXI6ckluWjNsf2pFQTVCdzVuellCTjVMWnNRNlMyWWR4dk8=

[INFO] Analysis report generated in C:\java\eclipse-mars\workspace\poc-sonar\target\sonar\batch-report
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.934s
[INFO] Finished at: Wed May 11 13:41:54 CEST 2016
[INFO] Final Memory: 56M/83M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project pocsonar: java.net.ConnectException: Connection timed out: connect -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project pocsonar: java.net.ConnectException: Connection timed out: connect
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.apache.maven.plugin.MojoExecutionException: java.net.ConnectException: Connection timed out: connect
    at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:81)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 25 more
Caused by: com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection timed out: connect
    at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151)
    at com.sun.jersey.api.client.filter.LoggingFilter.handle(LoggingFilter.java:183)
    at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:81)
    at com.sun.jersey.api.client.Client.handle(Client.java:648)
    at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
    at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
    at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)
    at ch.mibex.bitbucket.sonar.client.BitbucketClient.fetchPage(BitbucketClient.scala:209)
    at ch.mibex.bitbucket.sonar.client.BitbucketClient.ch$mibex$bitbucket$sonar$client$BitbucketClient$$fetchPullRequestsPage$1(BitbucketClient.scala:55)
    at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$findPullRequestsWithSourceBranch$1.apply(BitbucketClient.scala:72)
    at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$findPullRequestsWithSourceBranch$1.apply(BitbucketClient.scala:71)
    at ch.mibex.bitbucket.sonar.client.BitbucketClient.forEachResultPage(BitbucketClient.scala:219)
    at ch.mibex.bitbucket.sonar.client.BitbucketClient.findPullRequestsWithSourceBranch(BitbucketClient.scala:71)
    at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.findPullRequestsForConfiguredBranch(SonarReviewPostJob.scala:36)
    at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.executeOn(SonarReviewPostJob.scala:18)
    at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:65)
    at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55)
    at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:107)
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
    at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy16.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:78)
    ... 28 more
Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:90)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:380)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:236)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:218)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
    at java.net.Socket.connect(Socket.java:666)
    at com.ibm.jsse2.as.connect(as.java:490)
    at com.ibm.jsse2.ar.connect(ar.java:140)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:192)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
    at com.ibm.net.ssl.www2.protocol.https.c.<init>(c.java:134)
    at com.ibm.net.ssl.www2.protocol.https.c.a(c.java:82)
    at com.ibm.net.ssl.www2.protocol.https.d.getNewHttpClient(d.java:52)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1118)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1012)
    at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:38)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1528)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1456)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:491)
    at com.ibm.net.ssl.www2.protocol.https.b.getResponseCode(b.java:45)
    at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:249)
    at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)
    ... 69 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Process finished with exit code 1

How to update a new bitbucket version from 4.4.1 to 5.2.2??

Expected Behavior

Tell us what you expected to happen. When you are missing any SonarQube issus in your pull request, a screenshot of the file from the pull request in the SonarQube UI would be helpful.

Actual Behavior

What happened instead? If you have a screenshot or stack trace of the error, please attach it.

Plug-in version, SonarQube version, CI system, build type

The more we know about your setup, the easier it will be for us to reproduce the problem.

Allow wildcard on src.branchName

It would be good to use wildcards for the filter to get the pull requests.
If we use the gitFlow, we create heaps of feature/* and hotfix/* branches.

Currently we must provide a branch name for PR source and it's not possible to set "feature/**".
Or at least if we could provide the dest branch, it'll be more efficient.

Report only shows issues of current commit

For example:

We have a PR with 5 major and one minor issue.

Someone updated the PR to fix the minor one.

SonarQube Analysis reported no issues. Take a chocolate :-) And all issues are deleted.

What is really needed:

A report of all issues at lines changed in the PR diff. Or a report for every commit individually. Or both ;)

Not able to override the sonar.bitbucket.minSeverity

I tried to override the minimum severity by adding command line parameter to my maven job, but that failed.
-Dsonar.bitbucket.minSeverity= CRITICAL

maven-plugin:3.0.2:sonar (default-cli) on project ia-marketing: requirement failed: [sonar4bitbucket] Invalid severity
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)

Project Provisioning creates/provisions redundant Sonar Project with incorrect Master project key

Expected Behavior

When enabling Project Provisioning, Quality profiles and/or Project Properties, it should just like always create 1 project in SonarQube with the correct key and branch identifier:

  1. MyProjectName Feature_12345

Actual Behavior

When enabling Project Provisioning, i.e. checking Quality profiles and/or Project Properties, it does exactly what it is supposed to do, but als creates a Sonar Project with the Master Project Key as additional project name

  1. MyProjectName Feature_12345
  2. MyProjectName develop Feature_12345 ==> this should not be happening

This results in semi-duplicate useless projects in SonarQube that need to be manually deleted.

Plug-in version, SonarQube version, CI system, build type

Plug-in version: 1.11.3
SonarQube version: 6.2 - LGPL v3
CiSystem: Bamboo 5.15.3
Build type: happens on MSbuild and Maven

Regards,

Ithai.

Pull request checker always passes

I don't know if this is me using the plugin wrong or a bug, so please give feedback if I'm doing it wrong.

In our build process, at the end we run sonar as a gradle script:

./gradlew sonarqube \
    -Dsonar.host.url=http://**** \
    -Dsonar.login=**** \
    -Dsonar.password=**** \
    -Dsonar.bitbucket.branchName=${bamboo.repository.git.branch}

and then the Pull Request checker:

./gradlew sonarqube \
     -Dsonar.bitbucket.repoSlug=**** \
     -Dsonar.bitbucket.accountName=**** \
     -Dsonar.bitbucket.branchName=${bamboo.repository.git.branch} \
     -Dsonar.host.url=http://**** \
     -Dsonar.login=**** \
     -Dsonar.password=**** \
     -Dsonar.analysis.mode=issues \
     -Dsonar.bitbucket.oauthClientKey=**** \
     -Dsonar.bitbucket.oauthClientSecret=****

We have tried running both in one but the sonar did not update the analysis. Then we tried it separate, now sonar works as expected but all pull requests are passed while sonar reports new issues.

And btw, is there a way to make it that it says all issues, like even minor ones if we want?

Pull Requests not Analyzed

I have 2 questions here.

  1. We are using teamcity as the CI tool and Bitbucket as source control. I tried to analyze a pull request which is having around 250+ files and it failed. I think the issue is due to time take for loading the differences. Is there a way to increase the timeout? Error message is below

{"type": "error", "error": {"message": "Unable to respond in time"}}
[14:43:56][Step 7/7]
[14:43:56][Step 7/7] INFO: ------------------------------------------------------------------------
[14:43:56][Step 7/7] INFO: EXECUTION FAILURE
[14:43:56][Step 7/7] INFO: ------------------------------------------------------------------------
[14:43:56][Step 7/7] Total time: 29.980s
[14:43:56][Step 7/7] Final Memory: 12M/190M
[14:43:56][Step 7/7] ERROR: Error during Sonar runner execution
[14:43:56][Step 7/7] ERROR: Unable to execute Sonar
[14:43:56][Step 7/7] INFO: ------------------------------------------------------------------------
[14:43:56][Step 7/7] ERROR: Caused by: GET https://bitbucket.org/!api/2.0/repositories/*****/******/diff/******/*********:3b7f6db28f68%0D107c29eab8b3?context=0 returned a response status of 555 null

  1. We have develop branch and release branches and around 15+ development teams available. Every branch name is unique and pull request will be raised for release branch. Is there a way to analyze the all the pull requests raised for release branch? Using below parameters. Currently i am giving source branch name for every analysis

-Dsonar.bitbucket.repoSlug=***********
-Dsonar.bitbucket.accountName=*********
-Dsonar.bitbucket.teamName=***********
-Dsonar.bitbucket.oauthClientKey=*****************
-Dsonar.bitbucket.oauthClientSecret=***************
-Dsonar.bitbucket.branchName=$GIT_BRANCH
-Dsonar.host.url=************
-Dsonar.login=************
-Dsonar.password=************
-Dsonar.analysis.mode=issues
-Dsonar.bitbucket.minSeverity=INFO
-Dsonar.verbose=true
-Dsonar.bitbucket.approvalFeatureEnabled=false

Private BitBucket repository throw unauthorized exception.

Expected Behavior

Should post comments in BitBucket, can i set url for private bitbucket repository ?

Actual Behavior

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project cardinality: GET https://bitbucket.org/api/2.0/repositories/jenkins/test_project/pullrequests?page=1&pagelen=50&state=OPEN returned a response status of 401 Unauthorized -> [Help 1]

Plugin version: v1.2.1, SonarQube 6.4, Jenkins CI 2.61, Maven 3.39, BitBucket 4.4.0 (hosted in private cloud)

PullRequest comment with OAuth got 403

I'm trying to enable sonar4bitbucket when we build pullrequest under Jenkins CI server.

I made some try with API Key and it works but our IT department that handle the organisation accout is not happy of all comment messages. So I would try with OAuth authentication for the our builder account.

There is no some documentation on how to configure OAuth with this plugin, seems there are only 2 property to setup. After googling a lot the most helpful documentation is the comment of class ch.mibex.bitbucket.sonar.client.AuthenticationFilter.scala

Than:

  1. in bitbucket settings add a customer, this will generate a Key and a Secret
  2. also if optional we have to put a callback URL or the sonar plugin fails. I set to https://bitbucket.org/site/oauth2/authorize as described here
  3. add pullrequest and repository permission to write (is really needed? Could be called the first time you get deny when you post a comment?)

Now if I use the curl described in your comments all goes right.

bash$ curl -v -u "consumerKey:consumerSecret" https://bitbucket.org/site/oauth2/access_token  -d grant_type=client_credentials

response

{"access_token": "wmUR26aN7IIT3bZOyWHF8O9b77-r3-GG7RdgQs1DVQrQ1D1_Qsfn1a9486L8Eb_A43Z95LnHXW--f2Ei-HI=", "scopes": "pullrequest:write", "expires_in": 3600, "refresh_token": "dHMmFd48ATyffsRbrp", "token_type": "bearer"}
bash$ curl -v -X POST --data "content=test comment" -H "Authorization: Bearer oauth_token" https://bitbucket.org/api/1.0/repositories/acme/myrepository/pullrequests/1/comments

response

{"display_name": "R&D Builder", "parent_id": null, "filename_hash": null, "filename": null, "content": "test comment", "username": "builder", "pr_repo": {"owner": "acme", "slug": "myrepository"}, "deleted": false, "comment_id": 31849804, "comparespec": ... "is_repo_owner": false}

But if I run sonar analisys with the OAuth properties setup correctly I got the follow error

ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: [sonar4bitbucket] Couldn't fetch logged in user uuid, got status: 403
	at ch.mibex.bitbucket.sonar.client.BitbucketClient.getLoggedInUserUUID(BitbucketClient.scala:268)
	at ch.mibex.bitbucket.sonar.client.BitbucketClient.uuid$lzycompute(BitbucketClient.scala:33)
	at ch.mibex.bitbucket.sonar.client.BitbucketClient.uuid(BitbucketClient.scala:33)
	at ch.mibex.bitbucket.sonar.client.BitbucketClient.ch$mibex$bitbucket$sonar$client$BitbucketClient$$isFromUs$1(BitbucketClient.scala:104)
	at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$4$$anonfun$apply$2.apply(BitbucketClient.scala:109)
	at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$4$$anonfun$apply$2.apply(BitbucketClient.scala:109)
	at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:728)
	at scala.collection.immutable.List.foreach(List.scala:381)
	at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:727)
	at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$4.apply(BitbucketClient.scala:109)
	at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$4.apply(BitbucketClient.scala:108)
	at ch.mibex.bitbucket.sonar.client.BitbucketClient.fetchPage(BitbucketClient.scala:244)

it makes a call to register mibexsoftware as OAuth application (I see it in bitbucket) aftee that seems it lookup for all comments in the pull request and matches them against OAuth login but seems to fail.

My expectation is configure OAuth for the builder user that can access the repository and post sonar issues comment under its account instead use the team account.

Can you explain me what's is wrong?

Parse git diff fails for some pull requests - still

Hello,

I have 2 another 'Failed to parse git diff'.
I'm using version 1.1.0.

First one :

Stack trace :

[sonar4bitbucket] Failed to parse git diff: ` b/' expected but ` ' found
    at ch.mibex.bitbucket.sonar.diff.IssuesOnChangedLinesFilter.parseOrFail(IssuesOnChangedLinesFilter.scala:48)
    at ch.mibex.bitbucket.sonar.diff.IssuesOnChangedLinesFilter.filter(IssuesOnChangedLinesFilter.scala:19)
    at ch.mibex.bitbucket.sonar.review.ReviewCommentsCreator.processIssues(ReviewCommentsCreator.scala:76)
    at ch.mibex.bitbucket.sonar.review.ReviewCommentsCreator.createOrUpdateComments(ReviewCommentsCreator.scala:30)
    at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob$$anonfun$executeOn$1.apply(SonarReviewPostJob.scala:21)
    at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob$$anonfun$executeOn$1.apply(SonarReviewPostJob.scala:18)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.executeOn(SonarReviewPostJob.scala:18)
    at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:65)
    at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55)
    at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:107)
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
    at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
    at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)****

Diff file :
diff_case_1.txt

Second one

Caused by: java.lang.RuntimeException: [sonar4bitbucket] Failed to parse git diff: string matching regex `\z' expected but `
' found
    at ch.mibex.bitbucket.sonar.diff.IssuesOnChangedLinesFilter.parseOrFail(IssuesOnChangedLinesFilter.scala:48)
    at ch.mibex.bitbucket.sonar.diff.IssuesOnChangedLinesFilter.filter(IssuesOnChangedLinesFilter.scala:19)
    at ch.mibex.bitbucket.sonar.review.ReviewCommentsCreator.processIssues(ReviewCommentsCreator.scala:76)
    at ch.mibex.bitbucket.sonar.review.ReviewCommentsCreator.createOrUpdateComments(ReviewCommentsCreator.scala:30)
    at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob$$anonfun$executeOn$1.apply(SonarReviewPostJob.scala:21)
    at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob$$anonfun$executeOn$1.apply(SonarReviewPostJob.scala:18)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.executeOn(SonarReviewPostJob.scala:18)
    at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:65)
    at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55)
    at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:107)
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
    at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
    at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
    ... 9 more

Diff file :
diff_case_2.txt

The plug-in should not yield an 404 exception when there are no open pull requests for the given branch

Currently, the plug-in yields the following exception in that case:

Caused by: com.sun.jersey.api.client.UniformInterfaceException: GET returned a response status of 404 Not Found
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:686)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.fetchPage(BitbucketClient.scala:204)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.ch$mibex$bitbucket$sonar$client$BitbucketClient$$fetchPullRequestsPage$1(BitbucketClient.scala:51)
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$findPullRequestsWithSourceBranch$1.apply(BitbucketClient.scala:68)
at ch.mibex.bitbucket.sonar.client.BitbucketClient$$anonfun$findPullRequestsWithSourceBranch$1.apply(BitbucketClient.scala:67)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.forEachResultPage(BitbucketClient.scala:214)
at ch.mibex.bitbucket.sonar.client.BitbucketClient.findPullRequestsWithSourceBranch(BitbucketClient.scala:67)
at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.findPullRequestsForConfiguredBranch(SonarReviewPostJob.scala:36)
at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.executeOn(SonarReviewPostJob.scala:18)
at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:65)
at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:107)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:258)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:253)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 24 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.