Domanda

I am trying to set up SonarQube with a gradle project.

I have started a local Sonar process:

C:\Dev\Sonar\sonar-3.7\bin\windows-x86-64>StartSonar.bat
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | 2013-08-15 15:44:56.847:INFO:oejs.Server:jetty-7.6.11.v20130520
jvm 1    | JRuby limited openssl loaded. http://jruby.org/openssl
jvm 1    | gem install jruby-openssl for full support.
jvm 1    | 2013-08-15 15:45:27.198:INFO:oejsh.ContextHandler:started o.e.j.w.Web
AppContext{/,file:/C:/Dev/Sonar/sonar-3.7/war/sonar-server/},file:/C:/Dev/Sonar/
sonar-3.7/war/sonar-server
jvm 1    | 2013-08-15 15:45:27.261:INFO:oejs.AbstractConnector:Started SelectCha
nnelConnector@0.0.0.0:9000

I have applied the Sonar Plugin: apply plugin: "sonar-runner"

When I execute the Gradle Sonar task, I seeing this error:

gradle sonarRunner

...

* What went wrong:
Execution failed for task ':shared:sonarRunner'.
> org.sonar.api.utils.SonarException: Validation of project reactor failed:
  o root[mod_EricFrancis2]:shared is not a valid project or module key

Does anyone have any ideas on how to fix this error? Could it be a memory issue?

È stato utile?

Soluzione

Apparently, your Gradle project group or name contains a whitespace. This value becomes part of the default value for the Sonar project key, which must not contain whitespace. To fix the problem, you can either reconfigure the Gradle project group or name (it's safer not to have a whitespace in there anyway), or reconfigure the Sonar project key for the project that applies the sonar-runner plugin. The latter could look like this:

sonarProperties {
    property "sonar.projectKey", "foo:shared"
}

If the offender is the Gradle project name (rather than the group), you may have to reconfigure "sonar.projectName" as well.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top