sonar blame info from jazz

392 Views Asked by At

I am trying to retrieve blame information from our jazz repository. We are building our project with gradle and we want to analyze it with SonarQube. But the scm activity plugin of the SonarRunner gets this exception:

11:27:46.253 WARN  - Fail to retrieve SCM info of: C:\Users\path\to\source\file. Reason: Error code for Jazz SCM blame command - 47
Problem running 'annotate':
The URI to the repository that has the following UUID cannot be determined: [UUID]. The following workspaces are loaded from that repository: My Workspace. If you know the repository URI, run the lscm login command and specify the repository URI.

I allready checked the URI manually with the scm cli tool. Actually I have no idea where the UUID comes from, since I never defined it in the config. Only the URI to the workspace.

The SonarQube settings in build.gradle looks like this:

sonarRunner {
    //config parameters not needed for default localhost sonar installation
    sonarProperties {
        property "sonar.host.url", "https://myserver:9999"
        property "sonar.jdbc.url", "jdbc:postgresql://myserver/sonar"
        property "sonar.jdbc.driverClassName", "org.postgresql.Driver"
        property "sonar.jdbc.username", "sonar"
        property "sonar.jdbc.password", "sonar"
    }
}

tasks.sonarRunner.dependsOn = [] // workaround for defect http://issues.gradle.org//browse/GRADLE-2749
tasks.sonarRunner.mustRunAfter {
    subprojects.collect { project ->
      project.tasks.withType(Test)
    }
}

subprojects {
  sonarRunner {
       sonarProperties {
            property "sonar.sourceEncoding", "UTF-8"
            property "sonar.core.codeCoveragePlugin", "jacoco"
            property "sonar.jacoco.reportPath", "${buildDir}/jacoco/report.exec"

            property "sonar.scm.url" , "scm:jazz:https://myjazzserver:9444/jazz:My Workspace"
        }
    }
}

User name and password for Jazz are defined in sonar.

I already tried to write a task to log in with lscm.bat before the scm retrieve. This resulted only in an exception that the user is already logged in. I also tried to put user name and password into the scm url, but this resulted in this exception:

Exception in thread "Thread-21" java.lang.LinkageError: org.codehaus.plexus.util.IOUtil
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:306)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:143)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:700)
    at java.net.URLClassLoader.access$400(URLClassLoader.java:81)
    at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1148)
    at java.security.AccessController.doPrivileged(AccessController.java:366)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:583)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:389)
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
    at org.codehaus.plexus.util.cli.StreamPumper.run(StreamPumper.java:157)

And with this exception it get stuck.

And this are the verions of the tools: RTC: 4.0.2 Gradle: 1.9 SonarQube: 4.3.2 SCM Activity: 1.8

Does anyone has an idea, what I am doing wrong?

0

There are 0 best solutions below