maven - NullPointerException when analysing a Java project with SonarQube and when activating rules tracking quality issues in unit test source code -
i try execute sonarqube (post build action) analysis after jenkins job (maven clean install)
in jenkins job log have stack:
[info] --- sonar-maven-plugin:2.6:sonar (default-cli) @ saga --- [info] sonarqube version: 5.0 info: default locale: "en_us", source code encoding: "utf-8" info: work directory: /var/lib/jenkins/workspace/saga - integration continue - sonar/target/sonar info: sonarqube server 5.0 [info] [11:08:40.072] load global referentials... [info] [11:08:40.547] load global referentials done: 482 ms [info] [11:08:40.570] user cache: /home/jenkins/.sonar/cache [info] [11:08:40.617] install plugins [info] [11:08:40.801] install jdbc driver [info] [11:08:40.813] create jdbc datasource jdbc:postgresql://localhost/sonar [info] [11:08:43.805] initializing hibernate [info] [11:08:51.583] load project referentials... [info] [11:08:56.748] load project referentials done: 5165 ms [info] [11:08:56.751] load project settings [info] [11:08:58.344] loading technical debt model... [info] [11:08:58.429] loading technical debt model done: 85 ms [info] [11:08:58.468] apply project exclusions [info] [11:08:58.905] ------------- scan saga [info] [11:08:58.908] load module settings [info] [11:09:00.288] loading rules... [info] [11:09:00.877] loading rules done: 589 ms [info] [11:09:01.040] configure maven plugins [info] [11:09:01.713] compare previous analysis (2015-05-09) [info] [11:09:01.774] compare on 30 days (2015-05-04, analysis of 2015-05-05 04:13:40.173) [info] [11:09:01.780] no quality gate configured. [info] [11:09:02.133] initializer findbugsmaveninitializer... [info] [11:09:02.143] initializer findbugsmaveninitializer done: 12 ms [info] [11:09:02.144] base dir: /var/lib/jenkins/workspace/saga - integration continue - sonar [info] [11:09:02.144] working dir: /var/lib/jenkins/workspace/saga - integration continue - sonar/target/sonar [info] [11:09:02.149] source paths: src/main/webapp, pom.xml, src/main/java [info] [11:09:02.150] test paths: src/test/java [info] [11:09:02.151] binary dirs: target/classes [info] [11:09:02.151] source encoding: utf-8, default locale: en_us [info] [11:09:02.153] index files [info] [11:09:02.219] excluded sources: [info] [11:09:02.222] **q*.java [info] [11:09:04.555] 319 files indexed [info] [11:09:06.639] quality profile java: sonar way findbugs [info] [11:09:06.971] sensor javasquidsensor... [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 33.595 s [info] finished at: 2015-06-03t11:09:07+02:00 [info] final memory: 28m/169m [info] ------------------------------------------------------------------------ [error] failed execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project saga: null: mojoexecutionexception: nullpointerexception -> [help 1] org.apache.maven.lifecycle.lifecycleexecutionexception: failed execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project saga: null @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:216) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:153) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:145) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:116) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:80) @ org.apache.maven.lifecycle.internal.builder.singlethreaded.singlethreadedbuilder.build(singlethreadedbuilder.java:51) @ org.apache.maven.lifecycle.internal.lifecyclestarter.execute(lifecyclestarter.java:120) @ org.apache.maven.defaultmaven.doexecute(defaultmaven.java:347) @ org.apache.maven.defaultmaven.execute(defaultmaven.java:154) @ org.apache.maven.cli.mavencli.execute(mavencli.java:584) @ org.apache.maven.cli.mavencli.domain(mavencli.java:213) @ org.apache.maven.cli.mavencli.main(mavencli.java:157) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:483) @ org.codehaus.plexus.classworlds.launcher.launcher.launchenhanced(launcher.java:289) @ org.codehaus.plexus.classworlds.launcher.launcher.launch(launcher.java:229) @ org.codehaus.plexus.classworlds.launcher.launcher.mainwithexitcode(launcher.java:415) @ org.codehaus.plexus.classworlds.launcher.launcher.main(launcher.java:356) caused by: org.apache.maven.plugin.mojoexecutionexception @ org.codehaus.mojo.sonar.bootstrap.exceptionhandling.handle(exceptionhandling.java:41) @ org.codehaus.mojo.sonar.bootstrap.runnerbootstraper.execute(runnerbootstraper.java:139) @ org.codehaus.mojo.sonar.sonarmojo.execute(sonarmojo.java:132) @ org.apache.maven.plugin.defaultbuildpluginmanager.executemojo(defaultbuildpluginmanager.java:132) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:208) ... 19 more caused by: java.lang.nullpointerexception @ org.sonar.api.batch.rule.checks.getfield(checks.java:180) @ org.sonar.api.batch.rule.checks.configurefields(checks.java:167) @ org.sonar.api.batch.rule.checks.instantiate(checks.java:152) @ org.sonar.api.batch.rule.checks.addannotatedchecks(checks.java:127) @ org.sonar.java.sonarcomponents.registertestcheckclasses(sonarcomponents.java:128) @ org.sonar.plugins.java.javasquidsensor.analyse(javasquidsensor.java:82) @ org.sonar.batch.phases.sensorsexecutor.executesensor(sensorsexecutor.java:79) @ org.sonar.batch.phases.sensorsexecutor.execute(sensorsexecutor.java:70) @ org.sonar.batch.phases.phaseexecutor.execute(phaseexecutor.java:122) @ org.sonar.batch.scan.modulescancontainer.doafterstart(modulescancontainer.java:222) @ org.sonar.api.platform.componentcontainer.startcomponents(componentcontainer.java:93) @ org.sonar.api.platform.componentcontainer.execute(componentcontainer.java:78) @ org.sonar.batch.scan.projectscancontainer.scan(projectscancontainer.java:235) @ org.sonar.batch.scan.projectscancontainer.scanrecursively(projectscancontainer.java:230) @ org.sonar.batch.scan.projectscancontainer.doafterstart(projectscancontainer.java:223) @ org.sonar.api.platform.componentcontainer.startcomponents(componentcontainer.java:93) @ org.sonar.api.platform.componentcontainer.execute(componentcontainer.java:78) @ org.sonar.batch.scan.scantask.scan(scantask.java:65) @ org.sonar.batch.scan.scantask.execute(scantask.java:52) @ org.sonar.batch.bootstrap.taskcontainer.doafterstart(taskcontainer.java:128) @ org.sonar.api.platform.componentcontainer.startcomponents(componentcontainer.java:93) @ org.sonar.api.platform.componentcontainer.execute(componentcontainer.java:78) @ org.sonar.batch.bootstrap.bootstrapcontainer.executetask(bootstrapcontainer.java:171) @ org.sonar.batch.bootstrapper.batch.executetask(batch.java:95) @ org.sonar.batch.bootstrapper.batch.execute(batch.java:67) @ org.sonar.runner.batch.isolatedlauncher.execute(isolatedlauncher.java:48) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:483) @ org.sonar.runner.impl.batchlauncher$1.delegateexecution(batchlauncher.java:87) @ org.sonar.runner.impl.batchlauncher$1.run(batchlauncher.java:75) @ java.security.accesscontroller.doprivileged(native method) @ org.sonar.runner.impl.batchlauncher.doexecute(batchlauncher.java:69) @ org.sonar.runner.impl.batchlauncher.execute(batchlauncher.java:50) @ org.sonar.runner.api.embeddedrunner.doexecute(embeddedrunner.java:102) @ org.sonar.runner.api.runner.execute(runner.java:100) @ org.codehaus.mojo.sonar.bootstrap.runnerbootstraper.execute(runnerbootstraper.java:135) ... 22 more [error] [error] re-run maven using -x switch enable full debug logging. [error] [error] more information errors , possible solutions, please read following articles: [error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojoexecutionexception sonarqube analysis completed: failure build step 'sonarqube' changed build result failure build step 'sonarqube' marked build failure finished: failure
my sonar plugins:
- checkstyle 2.2
- cobertura 1.6.3
- findbugs 3.1
- java 3.3
- pmd 2.3
if delete sonar step in jenkins job don't have problem , job success
i don't know if jenkins or sonar problem.
thanks help
i'm having similar issue, , seems (1,2) should fixed upgrading sonar 4.5.4/5.0.1/5.1 per http://jira.sonarsource.com/browse/sonar-6162.
Comments
Post a Comment