Coder Social home page Coder Social logo

mc1arke / sonarqube-community-branch-plugin Goto Github PK

View Code? Open in Web Editor NEW
2.1K 79.0 490.0 1.07 MB

A plugin that allows branch analysis and pull request decoration in the Community version of Sonarqube

License: GNU Lesser General Public License v3.0

Java 99.88% Dockerfile 0.12%
sonarqube-plugin sonarqube sonarqube-analysis sonarqube-server sonarqube-scanner

sonarqube-community-branch-plugin's Introduction

Quality Gate Status Build Status

Sonarqube Community Branch Plugin

A plugin for SonarQube to allow branch analysis in the Community version.

Support

This plugin is not maintained or supported by SonarSource and has no official upgrade path for migrating from the SonarQube Community Edition to any of the Commercial Editions (Developer, Enterprise, or Data Center Edition). Support for any problems is only available through issues on the Github repository or through alternative channels (e.g. StackOverflow) and any attempt to request support for this plugin directly from SonarSource or an affiliated channel ( e.g. Sonar Community forum) is likely to result in your request being closed or ignored.

If you plan on migrating your SonarQube data to a commercial edition after using this plugin then please be aware that this may result in some or all of your data being lost due to this compatibility of this plugin and the official SonarQube branch features being untested.

Compatibility

Use the following table to find the correct plugin version for each SonarQube version

SonarQube Version Plugin Version
10.3 1.18.0
10.2 1.17.1
10.1 1.16.0
10.0 1.15.0
9.9 (LTS) 1.14.0

Older versions are listed on the Github release page but are no longer supported.

Features

The plugin is intended to support the features and parameters from the SonarQube documentation.

Installation

Manual Install

Please ensure you follow the installation instructions for the version of the plugin you're installing by looking at the README on the relevant release tag.

Either build the project or download a compatible release version of the plugin JAR .

  1. Copy the plugin JAR file to the extensions/plugins/ directory of your SonarQube instance
  2. Add -javaagent:./extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=web to the sonar.web.javaAdditionalOpts property in your Sonarqube installation's conf/sonar.properties file, e.g. sonar.web.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=web where ${version} is the version of the plugin being worked with. e.g 1.8.0
  3. Add -javaagent:./extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=ce to the sonar.ce.javaAdditionalOpts property in your Sonarqube installation's conf/sonar.properties file, e.g. sonar.ce.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=ce
  4. Start Sonarqube, and accept the warning about using third-party plugins

Docker

The plugin is distributed in the mc1arke/sonarqube-with-community-branch-plugin Docker image, with the image versions matching the up-stream Sonarqube image version.

Note: If you're setting the SONAR_WEB_JAVAADDITIONALOPTS or SONAR_CE_JAVAADDITIONALOPTS environment variables in your container launch then you'll need to add the javaagent configuration to your overrides to match what's in the provided Dockerfile.

Docker Compose

A docker-compose.yml file is provided. It uses the env variables available in .env.

To use it, clone the repository and execute docker-compose up. Note that you need to have docker-compose installed in your system and added to your PATH

Kubernetes with official Helm Chart

When using Sonarqube official Helm Chart, you need to add the following settings to your helm values, where ${version} should be replaced with the plugin version (e.g. 1.11.0). Beware of the changes made in helm chart version 6.1.0:

helm chart version < 6.1.0

plugins:
  install:
    - https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/${version}/sonarqube-community-branch-plugin-${version}.jar
  lib:
    - sonarqube-community-branch-plugin-${version}.jar
jvmOpts: "-javaagent:/opt/sonarqube/lib/common/sonarqube-community-branch-plugin-${version}.jar=web"
jvmCeOpts: "-javaagent:/opt/sonarqube/lib/common/sonarqube-community-branch-plugin-${version}.jar=ce"

helm chart version >= 6.1.0

plugins:
  install:
    - https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/${version}/sonarqube-community-branch-plugin-${version}.jar
jvmOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=web"
jvmCeOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=ce"

Issues with file path with persistency

If you set persistence.enabled=true on SonarQube chart, the plugin might be copied to this path, based on the helm chart version, mentioned above (${plugin-path} equals lib/common or extensions/plugins):

/opt/sonarqube/${plugin-path}/sonarqube-community-branch-plugin-${version}.jar/sonarqube-community-branch-plugin-${version}.jar

instead of this:

/opt/sonarqube/${plugin-path}/sonarqube-community-branch-plugin-${version}.jar

As a workaround either change the paths in the config above, or exec into the container and move file up the directory to match the config.

Configuration

Global configuration

Make sure sonar.core.serverBaseURL in SonarQube /admin/settings is properly set in order to for the links in the comment to work.

Set all other properties that you can define globally for all of your projects.

How to decorate a Pull Request

In order to decorate your Pull Request's source branch, you need to analyze your target branch first.

Run analysis of branches

If the scan is being run from a CI supporting auto-configuration then the scanner can be launched without any branch parameters. Otherwise, the analysis needs the following setting: sonar.branch.name = branch_name (e.g master)

Run analysis of the PR branch

Carefully read the official SonarQube guide for pull request decoration

In there you'll find the following properties that need to be set, unless your CI support auto-configuration.

sonar.pullrequest.key = pull_request_id (e.g. 100)
sonar.pullrequest.branch = source_branch_name (e.g feature/TICKET-123)
sonar.pullrequest.base = target_branch_name (e.g master)

โš ๏ธ There must not be any sonar.branch properties like sonar.branch.name arguments set when you analyze a pull-request. These properties indicate to sonar that a branch is being analyzed rather than a pull-request so no pull-request decoration will be executed.

Serving images for PR decoration

By default, images for PR decoration are served as static resources on the SonarQube server as a part of Community Branch Plugin.

If you use a SonarQube server behind a firewall and/or PR service (Github, Gitlab etc.) doesn't have access to SonarQube server, you should change Images base URL property in General > Pull Request settings.

Anyone needing to set this value can use the URL https://raw.githubusercontent.com/mc1arke/sonarqube-community-branch-plugin/master/src/main/resources/static, or download the files from this location and host them themself.

Building the plugin from source

If you want to try and test the current branch or build it for your development execute ./gradlew clean build inside of the project directory. This will put the built jar under libs/sonarqube-community-branch-plugin*.jar

sonarqube-community-branch-plugin's People

Contributors

4n4n4s avatar artemy-osipov avatar bluebu avatar cncgoko avatar crazy-max avatar dependabot[bot] avatar don-vip avatar goober avatar jcuzzi avatar jgrant216 avatar jizhilong avatar kennyko avatar ksl67 avatar mc1arke avatar ndeitch avatar nimble85 avatar nkelemen18 avatar piekj avatar rakdos8 avatar regentov avatar rgembalik avatar rwalravens avatar sfaqer avatar the-nuclear-gandhi avatar thomasgl-orange avatar tisoft avatar useful-devops-tools avatar uwej711 avatar vanroy avatar web-flow 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  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

sonarqube-community-branch-plugin's Issues

Could not target requested branch

Hello I have an issue when i submit a pullrequest analysis on a branch wich has never been analysed first.
I use a 7.4 version of SonarQube
The plugins list :
Plugins:

  • SonarPython 1.13.0.2922 (python)
  • SonarCSS 1.0.3.724 (cssfamily)
  • JaCoCo 1.0.1.143 (jacoco)
  • SonarGo 1.1.0.1612 (go)
  • SonarKotlin 1.4.0.155 (kotlin)
  • Svn 1.9.0.1295 (scmsvn)
  • SonarJS 5.1.1.7506 (javascript)
  • SonarRuby 1.4.0.155 (ruby)
  • SonarC# 7.11.0.8083 (csharp)
  • SonarJava 5.11.0.17289 (java)
  • LDAP 2.2.0.608 (ldap)
  • Git 1.7.0.1491 (scmgit)
  • SonarFlex 2.4.0.1222 (flex)
  • SonarXML 2.0.1.2020 (xml)
  • SonarPHP 3.0.0.4537 (php)
  • SonarTS 1.9.0.3766 (typescript)
  • SonarVB 7.11.0.8083 (vbnet)
  • Community Branch Plugin 1.0.2 (communityBranchPlugin)

I build using TfsGit as repository.
the relevant SonarQube parameters are:

  • "sonar.pullrequest.key":"43",
  • "sonar.pullrequest.base":"develop",
  • "sonar.pullrequest.branch":"features/unit-tests"

It result with an execution failure as above

EXECUTION FAILURE
2019-04-09T11:28:19.2296634Z 13:28:19.228 INFO: ------------------------------------------------------------------------
2019-04-09T11:28:19.2297060Z 13:28:19.228 INFO: Total time: 2.362s
2019-04-09T11:28:19.2521514Z 13:28:19.248 INFO: Final Memory: 9M/77M
2019-04-09T11:28:19.2531285Z 13:28:19.249 ERROR: Error during SonarQube Scanner execution
2019-04-09T11:28:19.2531854Z 13:28:19.249 INFO: ------------------------------------------------------------------------
2019-04-09T11:28:19.2532296Z java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectSettings
2019-04-09T11:28:19.2532747Z 	...
2019-04-09T11:28:19.2551496Z 	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
2019-04-09T11:28:19.2552015Z Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.repository.ProjectRepositories
2019-04-09T11:28:19.2552466Z 	...
2019-04-09T11:28:19.2567108Z 	... 36 more
2019-04-09T11:28:19.2567442Z Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
2019-04-09T11:28:19.2567730Z 	...
2019-04-09T11:28:19.2580320Z 	... 51 more
2019-04-09T11:28:19.2580489Z Caused by: Could not target requested branch
2019-04-09T11:28:19.2580705Z Caused by: java.lang.IllegalStateException: **Target branch 'develop' does not exist** 

If i first analyse the branch "develop" on non PullRequest build, i do not encounter an other issue:
Caused by: Could not target requested branch
2019-04-09T11:52:32.2246182Z Caused by: java.lang.IllegalStateException: Expected branch type of LONG but got SHORT

Is there any chance that your plugin can create the target and base branch if it not exist?

Thanks for your work anyway

Pull Request Decoration - Unknown url : /api/alm_settings/list_definit...

Describe the bug
Hello,
When I want to setup Pull Request Decoration and I open the settings page, I get an error:
Unknown url : /api/alm_settings/list_definit...
Screenshot
It seems that whole /api/alm_settings/ API prefix is missing in Community Edition of SonarQube.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Administration
  2. Configuration
  3. General Settings
  4. Pull Request Decoration
  5. See error at the top

Expected behavior
If Pull Request Decoration should be setup differently than it should be documented and maybe also mentioned that this error is expected when using Community Edition.

Is this a way how to setup Pull Request Decoration even in newer versions on SonarQube (7.8+)?https://docs.sonarqube.org/7.7/analysis/pull-request/#header-2

Screenshots
Screenshot

Software Versions

Additional context

Analysis of feature branch treats entire codebase as new code

Describe the bug
The problem is that the feature branch analysis doesn't show only new code and new bugs, code smells etc. It treats the entire codebase and every single quality issue as new.

To Reproduce
Steps to reproduce the behavior:

  1. Analyze master branch.
  2. Create feature branch based on master branch.
  3. Add 1 vulnerability.
  4. Analyze feature branch with sonar.branch.name=${name of feature branch}
  5. Analysis treats the entire codebase and every bug, code smell etc. as new.

Expected behavior
Analysis result should be 1 modified file and 1 new vulnerabilty.

Screenshots
Master branch analysis:
image

Feature Branch Analysis:
image

Software Versions

  • SonarQube Version: 8.0 (build 29455)
  • SonarScanner for MSBuild: 4.7.1
  • Plugin Version: 1.2.0

Additional context
Maybe I should add that this is a project using TFVC (sigh). With Git everything works just fine.

SQ[8.0] Scanner execution/reporting fails

Describe the bug
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to load component class org.sonar.scanner.scan.ProjectLock
ERROR: Caused by: Unable to load component class org.sonar.api.batch.fs.internal.DefaultInputProject
ERROR: Caused by: com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchParamsValidator.validate(Ljava/util/List;)V

SQ 8.0
Plugin 1.1.1

Scanner exception on retrieving existing pull request info

Whilst testing the fix for #4 an exception is thrown by the scanner engine when retrieving pull request info for a project containing an existing Pull Request analysis.

The stacktrace is

Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore: Unable to load component interface org.sonar
.scanner.scan.branch.BranchConfiguration: Unable to load component class org.sonar.scanner.scan.branch.ProjectPullRequests: java.lang.NumberFormatException: For input string: "2019-04-04T19:44:27+0100" -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project play-about: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentSto
re
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
...

and the content of a GET request to /api/project_pull_requests/list?project=xxx%3Aplay-about is

{"pullRequests":[{"key":"101","title":"dummybranch","branch":"dummybranch","base":"master","status":{"qualityGateStatus":"OK","bugs":0,"vulnerabilities":0,"codeSmells":0},"analysisDate":"2019-04-04T19:44:27+0100"}]}

No value for coverage difference for branches

We are using this plugin for a project in sonarqube but are having issues with coverage on branches.

In this exemple, we have a master-branch with 75.3% coverage and a branch with 81.4%.

In the column for coverage difference we just get a dash. Is this a bug?


Report upload from Azure CIDI do not work on Community edition for any branch except Master

Describe the bug
Report upload from Azure CIDI do not work on Community edition for any branch except Master

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Create build pipeline in azure devops and at the Run Code Analysis step it will fail'
  2. See error

_

INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=47ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 14 source files to be analyzed
INFO: SCM Publisher 14/14 source files have been analyzed (done) | time=573ms
INFO: CPD Executor 29 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 136 files
INFO: CPD Executor CPD calculation finished (done) | time=109ms
INFO: SCM writing changed lines
INFO: SCM writing changed lines (done) | time=187ms
INFO: Analysis report generated in 312ms, dir size=377 KB
INFO: Analysis report compressed in 203ms, zip size=208 KB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 56.494s
INFO: Final Memory: 16M/160M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarQube Scanner execution
ERROR: Failed to upload report - An error has occurred. Please contact your administrator
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
ERROR: Error during SonarQube Scanner execution
ERROR: Failed to upload report - An error has occurred. Please contact your administrator
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
##[error]The process 'D:\a_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.8.0\sonar-scanner\bin\sonar-scanner.bat' failed with exit code 1
##[section]Finishing: Run Code Analysis

_

Also if we check the web.log under logs folder we can see below

2019.10.30 07:49:10 ERROR web[AW4bh8qen6DU8a66AAIS][o.s.s.w.WebServiceEngine] Fail to process request http:///api/ce/submit?projectKey=&projectName=&characteristic=branch%3&characteristic=branchType%3DSHORT
java.lang.IllegalStateException: Current edition does not support branch feature
at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:63)
at org.sonar.server.ce.queue.ReportSubmitter.submit(ReportSubmitter.java:83)
at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:113)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:92)
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:138)
at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:88)
at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:76)
at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RequestIdFilter.doFilter(RequestIdFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)

Expected behavior
The Report should be updated to Sonarqube server

Screenshots
image

Software Versions

  • SonarQube Version: 8.0.0.29455
  • Plugin Version: sq-8_0-support Latest commit f2a3f56

Additional context
If we select the Master branch in CI for same it all works just fine and i can see the report under our install as seen in below screenshot
image

Exception when analysing PR targeting long lived branch

The following exception is raised when analysing a PR.
The master branch already exists for the project.

SonarScanner is started with parameters -Dsonar.pullrequest.branch=changes/19/14219/2 -Dsonar.pullrequest.key=14219

Any ideas ?

java.util.NoSuchElementException: No value present
	at java.util.Optional.get(Optional.java:135)
	at org.sonar.ce.task.projectanalysis.step.ValidateProjectStep.validateTargetBranch(ValidateProjectStep.java:94)
	at org.sonar.ce.task.projectanalysis.step.ValidateProjectStep.execute(ValidateProjectStep.java:77)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:81)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:72)
	at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:59)
	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:207)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:189)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:156)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:131)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:83)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:51)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Analysis fails with exception when project not created yet in Sonarqube

Hello.

I'm trying to test sources with command:

mvn test verify sonar:sonar $MAVEN_CLI_OPTS -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_TOKEN -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.gitlab.unique_issue_per_inline=true

But on new projects (that not yet created in Sonarqube) I've got exception:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project stat.profile: No branches currently exist in this project. Please scan the main branch without passing any branch parameters. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project stat.profile: No branches currently exist in this project. Please scan the main branch without passing any branch parameters.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: No branches currently exist in this project. Please scan the main branch without passing any branch parameters.
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.sonar.api.utils.MessageException: No branches currently exist in this project. Please scan the main branch without passing any branch parameters.

I have only one branch master and not passing any -Dsonar.branch.* to default command. How can I bypass this error?

java.lang.IllegalStateException: Current edition does not support branch feature

After downgrading from trial enterprise 8.0 to community 8.0, the following shows in the log every time I try to analyze the project:

2019.12.06 12:20:59 ERROR web[AW7ZokYU4EOXlpphAACM][o.s.s.w.WebServiceEngine] Fail to process request http://host:9000/api/ce/submit?projectKey=project.key&projectName=project-name&characteristic=branch%3Dfeature%2Fsome-feature&characteristic=branchType%3DSHORT
java.lang.IllegalStateException: Current edition does not support branch feature
        at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
        at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:63)
        at org.sonar.server.ce.queue.ReportSubmitter.submit(ReportSubmitter.java:83)
        at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:113)
        at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
        at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:92)
        at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:138)
        at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:88)
        at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:72)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:76)
        at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:58)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.sonar.server.platform.web.RequestIdFilter.doFilter(RequestIdFilter.java:66)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
        at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.base/java.lang.Thread.run(Unknown Source)

Plugin seems to be installed correctly (jar is copied into extensions/plugins and into lib/common), and shown as "Installed" in /admin/marketplace?filter=installed

Can anything be done for plugin to work correctly?
Thanks in advance.

need a global default value for sonar.pullrequest.provider

Most organization/company host their repositories with a single ALM(actually I just know ALM is github like tools, but not its full name, could anyone tell me?), a global default value for sonar.pullrequest.provider would reduce a lot of repeat configuration work.
I can contribute a PR if this feature is compatible with the original design.

Zero code coverage for branch with latest java-plugin version

Describe the bug
I've recently update all plugins on my SonarQube server and my developers noticed an issue with coverage on branches. With latest version of java-plugin 6.0 (build 20538) there is no coverage. I've downgrade plugin to 5.14 version and coverage come back.
In my opinion this is not an issue of a branch plugin, by u should look at this in future releases

To Reproduce
Steps to reproduce the behavior:

  1. Go to MarketPLace update java-plugin to latest version
  2. Execute maven build with coverage for branch
  3. Go to branch analysis and see zero coverage.

Expected behavior
Coverage for branch)

Screenshots
If applicable, add screenshots to help explain your problem.

Software Versions

  • SonarQube Version: 7.9.1 (build 27448)]
  • Plugin Version: 1.1.1

Additional context
Add any other context about the problem here.

Upgrade to support sonarqube 8.0

Describe the bug
For some reason, we need to upgrade to 8.0 ( sonarqube db is destroy, and 8.0 repair it ... ).
Did you plan to adapt the plugin for 8.0 ?

Here is the error from sonarqube :

java.lang.IllegalStateException: Fail to load plugin Community Branch Plugin [communityBranchPlugin]
	at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:88)
	at org.sonar.ce.container.ComputeEngineContainerImpl.startLevel4(ComputeEngineContainerImpl.java:230)
	at org.sonar.ce.container.ComputeEngineContainerImpl.start(ComputeEngineContainerImpl.java:196)
	at org.sonar.ce.ComputeEngineImpl.startup(ComputeEngineImpl.java:45)
	at org.sonar.ce.app.CeServer$CeMainThread.attemptStartup(CeServer.java:163)
	at org.sonar.ce.app.CeServer$CeMainThread.run(CeServer.java:141)
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")
	at java.base/java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.base/java.security.AccessController.checkPermission(Unknown Source)
	at java.base/java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.base/java.lang.ClassLoader.checkClassLoaderPermission(Unknown Source)
	at java.base/java.lang.Class.getClassLoader(Unknown Source)
	at com.github.mc1arke.sonarqube.plugin.classloader.ClassReferenceElevatedClassLoaderFactory.createClassLoader(ClassReferenceElevatedClassLoaderFactory.java:47)
	at com.github.mc1arke.sonarqube.plugin.CommunityBranchPluginBootstrap.define(CommunityBranchPluginBootstrap.java:60)
	at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:78)
	... 5 common frames omitted

To Reproduce
Steps to reproduce the behavior:

  1. Install sonarqube 8.0
  2. Add this plugin in plugin folder
  3. start sonarqube
  4. See error

Expected behavior
work

Software Versions

  • SonarQube Version: 8.0-beta
  • Plugin Version: 1.2.0-snapshot

Additional context
First, I'm not a java developper .

I try this :
Go in build.gradle,
change sonarqubeVersion to 8.0
start gradlew check
return this :

C:\Users\thib3\repos\sonarqube-community-branch-plugin\src\main\java\com\github\mc1arke\sonarqube\plugin\scanner\CommunityProjectBranchesLoader.java:28: error: cannot find symbol
import org.sonar.scanner.util.ScannerUtils;

( this is not the full stacktrace ) .
If I go in the file CommunityProjectBranchesLoader.java, I see intellij idea can't resolve all import from sonarqube ( and from google ) ... ( and idea can't see class inside the .java file for 8.0, but can for 7.8 ) .

I don't know how to help, but If you need help, you can ask :) .

Decorating Pull Requests

I would like to start a discussion for how the plugin would be able to support pull request decorations in a similar way that the commercial plugin does.

A former discussion was made in #3, but the initial issue was not related to supporting pull request decorations so I open a new issue to track the discussion of supporting pull request decorations in one place. Please feel free to close this if it is more preferable to continue the discussion in the other issue.

This is a suggestion for a solution based on my initial investigation on how the plugin lifecycle works in sonarqube.

By hooking in as a ComputeEngine extension with a PostProjectAnalysisTask, where we have access to the necessary metadata like quality gate results, we have the possibility to decorate the pull requests with some metadata.

For Bitbucket Server we would then use the Code Insights API.

However, the PostProjectAnalysisTask does not expose the individual issues reported in the scan so I suggest that we do this in two steps.

Step 1 - Support pull request decoration with the data available within the PostProjectAnalysisTask

Step 2 - Support pull request decoration of individual issues per line.

For step 2 I have not found any internal sdk to use to obtain the issues reported in the scan. Other plugins like quboo-sonarqube-plugin leverages sonarqubes REST api to obtain the necessary data about the scan.
See QubooConnector.java

If it is decided to go with the REST api approach we could still use the PostProjectAnalysisTask to decorate the changed lines within the pull request.

@mc1arke I guess that you have a lot of thoughts on how you want to tackle this?

Allow override configuration from cli

When an organisation has many repositories/projects, configuring projectSlug/repositorySlug for each one is quite exhausting. It would be nice to let specify these parameters from cli

ex:

docker run -ti -v $(pwd):/usr/src newtmitch/sonar-scanner:4.0.0-alpine \
  -Dsonar.host.url=$SONAR_URL \
  -Dsonar.projectKey="project:sample" \
  -Dsonar.projectName="sample" \
  -Dsonar.projectBaseDir=/usr/src \
  -Dsonar.sources=. \
  -Dsonar.pullrequest.key="13" \
  -Dsonar.pullrequest.branch="test-sonar" \
  -Dsonar.pullrequest.base="master" \
  -Dsonar.pullrequest.provider="BitbucketServer" \
  -Dcom.github.mc1arke.sonarqube.plugin.branch.pullrequest.bitbucket.projectKey="project" \
  -Dcom.github.mc1arke.sonarqube.plugin.branch.pullrequest.bitbucket.repositorySlug="sample"

PS I found similar solution from here https://community.sonarsource.com/t/post-analysis-task-only-when-scanner-parameter-set/12121.
If it fits, I can create a PR during the week.

Question: Short-lived branches and test results

Hi,

sorry for noob question and also for posting this as an issue but I didn't found any other way to ask a question.
We have simple quality that we would like to use as a check before merging PR into mastzer branch. One of the rules is that there is no failing unit tests but, it seems that Sonar (or this plugin take into account only rules that apply to 'new code') and test results are completely ignored.

For example, in one of PR branches (short-lived) I introduce some failing tests (without change in src code, just adding asserts within tests folder). When I scan branch it says that is ok but, if I merge this code back to master QG will fail due to failing tests.
Also, if this is a feature of short-lived branch, is thare any way to 'trick it' with configuring patter as long-lived branch? As far as I understood, in that case all gates should be verified but I'm worried how 'new code' would be calculated (e.g. is there any way to configure that all code on branch is a 'new code')? Also, is there any additional drawbacks that I could face?

Thx in advanced
Zoran

How to build and use this jar.

When building the it complains that the manifest is absent in the created jar. Tried pointing main class to the com.github.mc1arke.sonarqube.plugin.CommunityBranchPlugin without any success.

common internal model for issues in PR

Hi,

We are working on integrating Gerrit on the pr-decoration branch.
What we observed is that whatever backend is used for PR, there is a need for the same basic datas.
Of course, depending on the tool, some additional informations may be useful.

What about creating a common internal model for issues decorated in PR ?

  • a PR message : the comment set in the tool timeline, a general message about the decoration
  • file-wide issue : not specifically related to a line or range, along its severity
  • 0 or more line-issue : issues that are bound to a line in a file (or a range of lines), along there severities too

External issues ignored

Describe the bug
External issues are ignored in branches.

To Reproduce
Create a project with checkstyle report without errors and an empty quality profile.
Create the first build (create main sonar report for master).
Change branch and create checkstyle report with errors.
Run sonarqube in this branch.
There is no new condesmells. But if you run sonarqube on master with this report, new issues will appear.

Expected behavior
There is new condesmell in branch report.

Software Versions

  • SonarQube Version: 7.9.0.26994
  • Plugin Version: 1.1.1

Additional context
Report path configured in webUI.

Checks failed after update to 1.2.0

Describe the bug
After the update to 1.2.0 Sonar checks checks not work anymore.
After rollback to 1.1.1 all works fine again.

The web log contains the following entries:

2019.11.25 07:53:02 ERROR web[AW6TnIhOcOtvJkIuAAEs][o.s.s.w.WebServiceEngine] Fail to process request http://localhost:9000/api/ce/submit?projectKey=com.xxx.yyy.vvvv%3Areactor&projectName=vvvjjjjjj&characteristic=pullRequest%3D2017
java.lang.IllegalStateException: Current edition does not support branch feature
	at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
	at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:66)
	at org.sonar.server.ce.queue.ReportSubmitter.submit(ReportSubmitter.java:83)
	at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:121)
	at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
	at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:88)
	at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:126)
	at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:95)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:87)
	at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:71)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:76)
	at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:58)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.requestid.RequestIdFilter.doFilter(RequestIdFilter.java:63)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Unknown Source)

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Software Versions

  • SonarQube Version: 7.9.1
  • Plugin Version: 1.2.0

Additional context
Add any other context about the problem here.

Thanks for this Plugin!!

Nullpointer when sonar.branch.name is missing

When calling mvn sonar:sonar on a project where sonar.branch.name is not set at all, a Nullpointer will occur.

I would expect to get the main branch analysed.

[09:52:15] [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.1.1688:sonar (default-cli) on project xxx-maven-plugin: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration: NullPointerException -> [Help 1]

final Stacktrace:
Caused by: java.lang.NullPointerException at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.computeBranchType(CommunityBranchConfigurationLoader.java:145) at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.createBranchConfiguration(CommunityBranchConfigurationLoader.java:128) at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.load(CommunityBranchConfigurationLoader.java:97)

Sonar Qube 7.9.1 LTS
Branch Plugin 1.1.1

Current edition does not support branch feature

Describe the bug

2019.12.02 12:08:10 INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Community Branch Plugin / 1.2.0
2019.12.02 12:08:10 INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Git / 1.9.1.1834 / 178899f274b2e5340ea158ab885608a8ea228b61
2019.12.02 12:14:39 ERROR web[AW7Gg7T1/rt4OsQXAABL][o.s.s.w.WebServiceEngine] Fail to process request http://1.2.3.4:3000/api/ce/submit?projectKey=test&characteristic=branch%3Dredis&characteristic=branchType%3DSHORT
java.lang.IllegalStateException: Current edition does not support branch feature
	at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
	at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:63)
	at org.sonar.server.ce.queue.ReportSubmitter.submit(ReportSubmitter.java:83)
	at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:113)
	at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
	at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:88)
	at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:138)
	at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:88)
	at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:72)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:76)
	at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:58)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.RequestIdFilter.doFilter(RequestIdFilter.java:66)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Unknown Source)

To Reproduce
Steps to reproduce the behavior:

RUN COMMAND: sonar-scanner -Dsonar.host.url=http://1.2.3.4:3000 -Dsonar.projectKey=test -Dsonar.sources=. -Dsonar.branch.name=redis -X

Expected behavior
A clear and concise description of what you expected to happen.

Software Versions

  • SonarQube Version: 8.1-SNAPSHOT(3a7c8c6)
  • Plugin Version: 1.2.0

Sonar 8.1 java.lang.NoSuchFieldError: LONG

Issue during running sonar analysis since sonar 8.1.

To Reproduce
Steps to reproduce the behavior:

  1. Running maven analysis with param -Dsonar.branch.name=xxxx
  2. The error :
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar
Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
Caused by: java.lang.NoSuchFieldError: LONG
    at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.createBranchConfiguration ([CommunityBranchConfigurationLoader.java:133])
    at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.load (CommunityBranchConfigurationLoader.java:97)
    at org.sonar.scanner.scan.branch.BranchConfigurationProvider.provide (BranchConfigurationProvider.java:43)

Error here in the code
Expected behavior
No error

Software Versions

  • SonarQube Version: 8.1
  • Plugin Version: Community Branch Plugin 1.2.0 (communityBranchPlugin)

Additional context
It seems that the place where to define long branch name by project has changed in sonar ui.

Short-lived branch -> no issues

Expected Behavior

New Issues appear (difference) in Issues tab in short-lived branch

Actual Behavior

Once I purposely added new bug (possible null reference exception in c# code) in pull request branch, that bug was recognized and presented in Overview tab. But if i go to issues tab, I see nothing.

Example for PR-60 (Short lived branch) from develop (Base branch)

Overview tab
Issues tab

In addition I see interesting error on top, that lanalysis is failed. I observed that error appear on any failed analysis (develop branch - base) included. Could be this error related?

Error

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

Sonar: 7.7.0.23042
Community Branch Plugin: 1.0.2

pullrequest decoration comments should include a link to sonarqube's task detail page and vice versa

For now, the pullrequest decoration message only contains a brief summary of the analysis, but no direct link to guide the developer to the sonarqube's task page, where he/she can view the details of each metric category. As a workaround, one can find the sonar task link at gitlabci's CI/CD pipeline page, which could be more convenient if it was already included in the pullrequest decoration message. And on sonar's task page, a link to the corresponding PR/MR page would also make life easier.

Allow an empty project to scan with a long-term branch

Hi,

Our builds have for a long time populated the sonar branch properties; this was established some years ago and before sonarqube would error out when they were used without the developer version. I figure this plugin can help such workflows migrate to 7.9 LTS, but I ran into the requirement to scan the "main" branch first.

So I modified the plugin to proceed directly with the branch name rather than error out in the CommunityBranchConfigurationLoader:

    if (projectBranches.isEmpty()) {
        if (isTargetingDefaultBranch(localSettings)) {
            return new DefaultBranchConfiguration();
        } else {
            String branchName = localSettings.get(ScannerProperties.BRANCH_NAME);
            String branchTarget = localSettings.get(ScannerProperties.BRANCH_TARGET);
            final BranchType branchType = computeBranchType(localSettings.get(CoreProperties.LONG_LIVED_BRANCHES_REGEX), branchName);
            return new CommunityBranchConfiguration(branchName, branchType, branchTarget, branchTarget, null);
        }
    }

And I found it worked just fine. You can go on to scan the master at a later date, or rename and delete branches as appropriate.

So the above code is what I'm using, and I think that it might help others in the same situation.

I didn't feel confident enough to make this a PR though, because I'm not sure what the purpose of this limitation was in the first instance. Also, I wasn't sure whether there could be some subtleties with target branches for short-lived branches. If so perhaps the solution could be the following:

    if (projectBranches.isEmpty()) {
        if (isTargetingDefaultBranch(localSettings)) {
            return new DefaultBranchConfiguration();
        } else {
            String branchName = localSettings.get(ScannerProperties.BRANCH_NAME);
            final BranchType branchType = computeBranchType(localSettings.get(CoreProperties.LONG_LIVED_BRANCHES_REGEX), branchName);
            if (branchType == BranchType.LONG) {
                return new CommunityBranchConfiguration(branchName, branchType, branchName, branchName, null);
            } else {
                throw MessageException
                        .of("No branches currently exist in this project. Please either scan the main branch or a long-lived branch first");

            }
        }
    }

But my preference would be the first, simpler approach which would basically make this plugin a complete solution to allow existing workflows that use sonar branch properties update to 7.9 LTS.

Thoughts?

To use the property "sonar.branch.name" and analyze branches, Developer Edition or above is required

SonarQube 7.9.1 complains when I pass the sonar.branch.name parameter that it requires the developer edition. This is being passed through Gitlab CICD with the following line:

mvn package sonar:sonar -Dsonar.host.url=$Sonar_URL -Dsonar.login=$Sonar_USER -Dsonar.password=$Sonar_PASS -Dsonar.branch.name=$CI_COMMIT_REF_NAME

INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  24.979 s
[INFO] Finished at: 2019-11-20T21:22:50Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project hello_world: Validation of project reactor failed:
[ERROR]   o To use the property "sonar.branch.name" and analyze branches, Developer Edition or above is required. See https://redirect.sonarsource.com/doc/branches.html for more information.

The plugin does appear to be working as I have branch options within the SonarQube UI now that I didn't previously since I added the plugin.

If I remove the sonar.branch.name parameter it goes through fine. I can also rename a master to a branch name inside the SQ UI, but cannot seem to push them through automatically from the CLI.

Sonar is still complaining about the 'branch' parameter after installation of the plugin

Hello.
Perhaps I didn't understand something, but how to use this plugin?
I installed it, restarted SonarQube and tried to run the analysis one more time with the 'branch' parameter defined, however it is still complaining that branch analysis is available in Developer Edition and above.

The command that I'm trying to run:
sonar:sonar -Dsonar.branch="4.5-SNAPSHOT" -Dsonar.projectName="4.5-SNAPSHOT"

Can not switch branch from Sonarqube UI

In sonarqube 7.4, I can see branches in the project summary but I can not switch from the master to others.

In the chrome console, I can see an error 404 on this request :

/api/navigation/component?componentKey=myproject-main&branch=develop%C2%A0

This does not happen on all projects. I do not know if there is a link but only project in TypeScript seems to have this issue.

Same happen with sonar-scanner :

ERROR: Caused by: Target branch 'develop' does not exist

Does not work on latest 7.7

Web server startup failed when plugin placed in the latest 7.7 version of sonarqube. This is using the dockerised version of sonarqube community edition. Built the plugin using gradle in the repo and copied to mounted directory. No additional logging could be found on my attempt to run

NullPointerException in JSON Deserializer

Describe the bug
Our jenkins pipeline worked well, but then I deleted a long living branch in sonarqube (not in git!) to be able to rename the default branch from master to the name of the long living branch. Then the pipeline stopped to work.

Expected behavior
The gradle plugin should run even if there is no existing analysis.

Stacktrace

Caused by: java.lang.NullPointerException
        at com.github.mc1arke.sonarqube.plugin.scanner.CommunityProjectPullRequestsLoader.lambda$createPullRequestInfoJsonDeserialiser$0(CommunityProjectPullRequestsLoader.java:76)
        at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
        at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
        at com.google.gson.Gson.fromJson(Gson.java:922)
        at com.google.gson.Gson.fromJson(Gson.java:860)
        at com.github.mc1arke.sonarqube.plugin.scanner.CommunityProjectPullRequestsLoader.load(CommunityProjectPullRequestsLoader.java:87)
        at org.sonar.scanner.scan.branch.ProjectPullRequestsProvider.provide(ProjectPullRequestsProvider.java:47)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
        at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
        at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
        at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
        at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
        at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
        ... 150 more

Software Versions

  • SonarQube Version: 7.8
  • Plugin Version: version contained in sonar gradle plugin v2.7.1 and v2.8

Last Analysis Date was not updated on Sonar7.9.2

Describe the bug
A clear and concise description of what the bug is.
mvn sonar:sonar -Dsonar.branch.name to run an anayalis and it was successfully executed and the result was pushed to a Sonar7.9.2 server.
But on this server, the project's status was not updated on SonarQube's dashboard.

To Reproduce
Steps to reproduce the behavior:

  1. mvn sonar:sonar -Dsonar.branch.name, nothing updated on SonarQube's dashboard.
  2. mvn sonar:sonar, and the project's status was updated on SonarQube's dashboard.

Software Versions

  • SonarQube Version: 7.9.2
  • Plugin Version: 1.2.0

Issue using plugin alongside devops sonarqube task?

Hello,

I'm trying to make use of this plugin for SonarQube Community 8.1, with Sonar Tasks triggered from Devops in a yaml pipeline. Running the Prepare, Analyse and Report tasks for a master branch work fine with the plugin installed, but when I try to run a branch pipeline, I'm receiving the following

(I've double-checked and the .jar is in both lib\common and extensions\plugin for the plugin)

##[error]ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
	at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
	at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
	at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
	at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
	at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
	at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
	at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
	at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
	at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
	at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
##[error]at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
	... 34 more
Caused by: java.lang.NoSuchFieldError: LONG
	at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.computeBranchType(CommunityBranchConfigurationLoader.java:146)
	at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.createBranchConfiguration(CommunityBranchConfigurationLoader.java:128)
	at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.load(CommunityBranchConfigurationLoader.java:97)
	at org.sonar.scanner.scan.branch.BranchConfigurationProvider.provide(BranchConfigurationProvider.java:43)
	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.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
	at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
	at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
	at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
	at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
	at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
	at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
	... 48 more
ERROR:
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
	... 34 more
Caused by: java.lang.NoSuchFieldError: LONG
	at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.computeBranchType(CommunityBranchConfigurationLoader.java:146)
	at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.createBranchConfiguration(CommunityBranchConfigurationLoader.java:128)
	at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.load(CommunityBranchConfigurationLoader.java:97)
	at org.sonar.scanner.scan.branch.BranchConfigurationProvider.provide(BranchConfigurationProvider.java:43)
	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.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
	at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
	at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
	at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
	at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
	at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
	at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
	... 48 more
ERROR: 
##[error]The SonarQube Scanner did not complete successfully
The SonarQube Scanner did not complete successfully
##[error]08:49:57.662  Post-processing failed. Exit code: 1
08:49:57.662  Post-processing failed. Exit code: 1
##[error]The process 'C:\Program Files\Azure\Agent\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.8.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
##[section]Finishing: Run Code Analysis

Any guidance would be appreciated

PR decoration on github

Hi, thanks for the plugin work !

I am trying to decorate my pull requests on github, is this suposed to work ?
I didn't find any settings related to it in the plugin.

Any advice very apreciated ;)

Unable to read plugin manifest from jar

Describe the bug
SonarQube version: 7.9 LTS
Plugin version: 1.1.1

To Reproduce
Steps to reproduce the behavior:

  1. Added the plugin
  2. Start sonar using sonar.sh
  3. Sonar is not able to start

Web server startup failed
java.lang.IllegalStateException: Unable to read plugin manifest from jar : /apps/tools/sonarqube-7.9/extensions/plugins/sonarqube-community-branch-plugin-1.1.1.jar
Screenshots
If applicable, add screenshots to help explain your problem.

Software Versions

  • SonarQube Version: [e.g. Version 7.8 (build 26217)]
  • Plugin Version: [e.g. 1.1.0, or custom build from master at commit 004AD34FAA]

Additional context
Add any other context about the problem here.

Short living branch shows only coverage estimated after merge

Versions:

Sonar Docker sonarqube:7.9.1-community
Plugin: sonarqube-community-branch-plugin-1.1.1.jar

When I perform an analysis of a short living branch (branched from master) I do only see the coverage estimated after merge and not of the branch itself.

Command:
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.password=admin -Dsonar.branch.name=feature/test -Dsonar.branch.target=master

coverage

What is wrong here?

Sonarqube 7.9 branches not working

Describe the bug
Plugin does not work with the recently released Sonarqube 7.9

To Reproduce
Analyze a project against a Sonarqube 7.9 server with plugin version 1.1.1 installed.

Expected behavior
Analysis succeeds.

Scanner Output
The following can be seen in the output:

ERROR: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
ERROR: Caused by: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
ERROR: Caused by: Receiver class com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader does not define or inherit an implementation of the resolved method abstract load(Ljava/util/Map;Lorg/sonar/scanner/scan/branch/ProjectBranches;Lorg/sonar/scanner/scan/branch/ProjectPullRequests;)Lorg/sonar/scanner/scan/branch/BranchConfiguration; of interface org.sonar.scanner.scan.branch.BranchConfigurationLoader.
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

Software Versions

  • SonarQube Version: 7.9
  • Plugin Version: 1.1.1

Additional context
Project analysis works with SQ 7.8 and same plugin version 1.1.1. Upgrade to 7.9 shows this, most likely the Sonarqube branch API changed again.

plugin seems to not get loaded in sonarqube 8.0

Describe the bug
We upgraded to sonarqube 8.0 and sonarqube-community-branch-plugin 1.2.0, but we cannot choose branches anymore, with sonarqube 7.9 and branch-plugin 1.1.1 it worked fine.
The Marketplace shows it is installed, there are no errors regarding the plugin in the logs, only this:

2019.11.28 11:32:54 INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Community Branch Plugin / 1.2.0

Expected behavior
Being able to switch branches

Screenshots
Bildschirmfoto von 2019-11-28 11-26-16

Software Versions

  • SonarQube Version: 8.0 (build 29455)
  • Plugin Version: 1.2.0

Anyone else experiencing this? Any way to debug why it is not loaded?

Thanks!

Problem with long lived branch

If Sonarqube identifies a branch as a "longLivedBranche"(based not the regex expression), the sonar analysis breaks with the following error:

image

No issues with short living branches.

Sonarqube Version: 7.7.0
Branch Plugin Version: 1.0.2

[Question] No metrics for any of the branches

I am a fairly new user of SonarQube and stumbled upon your plugin, but I am starting to doubt if I am using it correctly, I hope that you can either confirm that or point me in the right direction. Sorry of the mistakes I make are obvious.

I have started running sonar-scanner for master branch and the results get displayed in SQ correctly, with many smells/issues detected.
Next, I checked out a branch "sprint_nn", edited the sonar.properties files and added the sonar.branch.name=xxx name. This branch becomes visible in SQ, but all of the metrics/issues/measures/code tabs shows nothing (all passed, while master fails while many smells/issues)

Am I using your plugin incorrectly?

Missing documentation for parameters

Describe the bug

As a new user, I encounter difficulties understanding the meaning of the different parameters I can set in the sonar-project.properties.

To Reproduce

What is the difference between sonar.branch.name and sonar.branch.target?

Expected behavior
A small description in the README or some examples could help a lot.

fail to do gitlab merge request decoration on absence of new_coverage metric

Describe the bug
the pull request analysis for gitlab is succefully created, while the pr decoration failed, with trace back as follows appearing in ce.log:

020.01.10 04:08:22 ERROR ce[AW-No1gDpsRBuIhDvm6H][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Execution of task class com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask failed
java.lang.IllegalStateException: There is no value when status is NO_VALUE
	at com.google.common.base.Preconditions.checkState(Preconditions.java:197)
	at org.sonar.ce.task.projectanalysis.api.posttask.ConditionImpl.getValue(ConditionImpl.java:163)
	at java.base/java.util.Optional.map(Unknown Source)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.AnalysisDetails.createAnalysisSummary(AnalysisDetails.java:109)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.gitlab.GitlabServerPullRequestDecorator.decorateQualityGateStatus(GitlabServerPullRequestDecorator.java:160)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask.finished(PullRequestPostAnalysisTask.java:126)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:113)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:107)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:91)
	at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:63)
	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:209)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:191)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:158)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:133)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:85)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Software Versions

  • SonarQube Version: Version 7.9.2 (build 30863)
  • Plugin Version: custom build from master at commit 9a12d6d

Approve PR that passed quality gate

This feature will allow to configure the PR to make it required to pass the quality gate. It is only necessary to add a comment user to the required reviewers.

sonarqube 7.4 branch

Hello,

I'm using Sonarqube 7.4 in docker(official image) with an extended folder with extensions
If I'm running like this

bat "D:\\sonar-scanner-msbuild\\SonarQube.Scanner.MSBuild.exe begin /k:project /d:sonar.host.url=http://192.168.100.10:9000 /d:sonar.login=token"
bat "\"${MSBUILD}\" main\\project.sln"
 bat "D:\\sonar-scanner-msbuild\\SonarQube.Scanner.MSBuild.exe end /d:sonar.login=token"

All works, but if I added /d:sonar.branch.name=test - I've got an error:

bat "D:\\sonar-scanner-msbuild\\SonarQube.Scanner.MSBuild.exe begin /k:project/d:sonar.host.url=http://192.168.100.10:9000 /d:sonar.branch.name=test /d:sonar.login=token"
bat "\"${MSBUILD}\" main\\project.sln"
bat "D:\\sonar-scanner-msbuild\\SonarQube.Scanner.MSBuild.exe end /d:sonar.login=token"
[ERROR: Error during SonarQube Scanner execution
ERROR: Unable to load component class org.sonar.scanner.phases.AbstractPhaseExecutor
ERROR: Caused by: Unable to load component class org.sonar.scanner.phases.PostJobsExecutor
ERROR: Caused by: Unable to load component class org.sonar.scanner.bootstrap.ScannerExtensionDictionnary
ERROR: Caused by: Unable to load component class org.sonar.scanner.sensor.DefaultSensorContext
ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.DefaultModuleFileSystem
ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.StatusDetection
ERROR: 
The SonarQube Scanner did not complete successfully]

While SQ is running, I have warnings:

2019.05.06 18:56:11 INFO  ce[][o.s.c.c.CePluginRepository] Load plugins
2019.05.06 18:56:13 WARN  ce[][o.s.c.p.ComponentKeys] Bad component key: org.sonar.java.externalreport.ExternalRulesDefinition@11d7a390. Please implement toString() method on class org.sonar.java.externalreport.ExternalRulesDefinition
2019.05.06 18:56:13 WARN  ce[][o.s.c.p.ComponentKeys] Bad component key: org.sonar.java.externalreport.ExternalRulesDefinition@4429ab31. Please implement toString() method on class org.sonar.java.externalreport.ExternalRulesDefinition
2019.05.06 18:56:13 WARN  ce[][o.s.c.p.ComponentKeys] Bad component key: org.sonar.java.externalreport.ExternalRulesDefinition@7e3d1fb2. Please implement toString() method on class org.sonar.java.externalreport.ExternalRulesDefinition

Could you help me, what am I doing wrong?
P.S. I'm using plugin version 1.0.2
P.S.S. analyses from master branch exists

Documentation

Hi,

After the installation of the Community Branch Plugin it seems the parameters sonar.branch.target and sonar.branch.name doesn't work. On my logs I've the Current edition does not support branch feature error.

What I'm missing?

Thank you.

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.