我正在尝试从我们的jazz存储库中检索blame信息。我们正在使用gradle构建项目,我们希望使用SonarQube进行分析。但是SonarRunner的scm活动插件得到了这个例外:
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.
我已经使用scm cli工具手动检查了URI。实际上我不知道UUID来自哪里,因为我从未在配置中定义它。只有工作区的URI。
build.gradle中的SonarQube设置如下所示:
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"
}
}
}
Jazz的用户名和密码在声纳中定义。
我已经尝试在scm检索之前编写一个用lscm.bat
登录的任务。这仅导致用户已登录的异常。
我还尝试将用户名和密码放入scm url,但这导致了这个异常:
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)
除此之外,它会被卡住。
这是工具的版本: RTC:4.0.2 Gradle:1.9 SonarQube:4.3.2 SCM活动:1.8
有没有人有想法,我做错了什么?