File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Not able to execute sonar from Jenkins Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Not able to execute sonar from Jenkins" Watch "Not able to execute sonar from Jenkins" New topic
Author

Not able to execute sonar from Jenkins

sandeep mathur
Greenhorn

Joined: May 21, 2004
Posts: 9
Hi,

I am running sonar from Jenkins job. I am getting following exception while executing sonar. I have added Findbugs, PMD and checkStyle rules in sonar.

Can someone please explain me the reason of this error. Thanks in advance...


[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar

Embedded error: Can not execute Findbugs
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: org.sonar.api.utils.SonarException: Can not execute Findbugs
at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:133)
at org.sonar.plugins.findbugs.FindbugsSensor.analyse(FindbugsSensor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64)
at org.sonar.batch.phases.Phases.execute(Phases.java:93)
at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:139)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:115)
at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:105)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:111)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:60)
at org.sonar.maven.SonarMojo.execute(SonarMojo.java:150)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
... 21 more
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:228)
at java.util.concurrent.FutureTask.get(FutureTask.java:91)
at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:127)
... 36 more



Thanks,

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

When you mention "sonar", do you mean: http://www.sonarsource.org/?

The output you posted is from Maven. You said that the build was running via Jenkins. Does the Maven build work correctly on your dev machine if you run the Maven build from the command line (in other words, not from Jenkins)?

Also, it might help if you posted the <plugin> entry for sonar in your pom.xml.


JBoss In Action
sandeep mathur
Greenhorn

Joined: May 21, 2004
Posts: 9
Hi Peter,

Thanks for your reply.

Yes when mentioning sonar I mean http://www.sonarsource.org/? .

I got the solution for this issue. This was caused because the module on which I was running the sonar was big and the build machine was very slow. I have increased the timeout value in Findbug and it worked.


Thanks,
Sandeep
Sibi Joseph
Greenhorn

Joined: Jan 31, 2007
Posts: 7
Hi sandeep

Thanks Sandeep for the info , it worked for me by setting the property sonar.findbugs.timeout. I have set the property within my sonar-project.properties file present in the root of the prioject being analysed by sonar runner tool.

sonar.findbugs.timeout=1200000

Thanks and Regards
Sibi


sandeep mathur wrote:Hi Peter,

Thanks for your reply.

Yes when mentioning sonar I mean http://www.sonarsource.org/? .

I got the solution for this issue. This was caused because the module on which I was running the sonar was big and the build machine was very slow. I have increased the timeout value in Findbug and it worked.


Thanks,
Sandeep
 
jQuery in Action, 2nd edition
 
subject: Not able to execute sonar from Jenkins