How to use dot-notation properties in maven site apt files? - maven

The documentation for maven site plugin http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html#Filtering suggests using $context to access properties with dot-notation.
I have a property nexus.url in my pom file. Using $context.get("nexus.url") or $context.get("parent.version") in the .apt file gives a parsing error:
[ERROR] Error parsing src/site/apt/readme.apt.vm as a velocity template, using as text.
Running mvn with -X flag gives out this trace:
java.lang.RuntimeException: Exception when invoking public void org.apache.velocity.tools.generic.SafeConfig.configure(java.util.Map) on org.apache.velocity.tools.view.ViewContextTool#6a950a3b
at org.apache.velocity.tools.ToolInfo.invoke(ToolInfo.java:375)
at org.apache.velocity.tools.ToolInfo.configure(ToolInfo.java:294)
at org.apache.velocity.tools.ToolInfo.create(ToolInfo.java:255)
at org.apache.velocity.tools.Toolbox.getFromInfo(Toolbox.java:152)
at org.apache.velocity.tools.Toolbox.get(Toolbox.java:112)
at org.apache.velocity.tools.ToolContext.findTool(ToolContext.java:221)
at org.apache.velocity.tools.ToolContext.get(ToolContext.java:206)
at org.apache.velocity.context.InternalContextAdapterImpl.get(InternalContextAdapterImpl.java:219)
at org.apache.velocity.runtime.parser.node.ASTReference.getVariableValue(ASTReference.java:740)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
at org.apache.velocity.Template.merge(Template.java:254)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:508)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderDocument(DefaultSiteRenderer.java:354)
at org.apache.maven.doxia.siterenderer.DoxiaDocumentRenderer.renderDocument(DoxiaDocumentRenderer.java:51)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:311)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:129)
at org.apache.maven.plugins.site.render.SiteMojo.renderDoxiaDocuments(SiteMojo.java:261)
at org.apache.maven.plugins.site.render.SiteMojo.renderLocale(SiteMojo.java:172)
at org.apache.maven.plugins.site.render.SiteMojo.execute(SiteMojo.java:141)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.NullPointerException
at org.apache.velocity.tools.view.ViewContextTool.configure(ViewContextTool.java:69)
at org.apache.velocity.tools.generic.SafeConfig.configure(SafeConfig.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.velocity.tools.ToolInfo.invoke(ToolInfo.java:363)

Figured it out. It works fine with version 3.5.1 of maven-site-plugin.

Related

CI Build failing with forked process error

Tests was running fine locally and were running with my jenkins server as well but somehow have started failing with error
Please refer to
There was an error in the forked process
null
org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
null
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:665)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:279)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:243)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1077)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:907)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:785)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Have tried with different version of maven-surefire-plugin but it still not help.
Have tried with <useSystemClassLoader>false</useSystemClassLoader> too but sill facing issue.
I had the same problem. Please make sure the:
-Dmaven.test.failure.ignore
flag is set for your Maven Jenkins job.

Jenkins no such method error maven project

Unable to build my java project which have maven 3.0 same as my jenkins version. jenkins has pulled the code correctly but is not able to complete parsing of pom.xml.
Following are the errors given by jenkins:
I[INFO] Reading assembly descriptor: src/main/assembly/package.xml
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoSuchMethodError: org.apache.maven.project.MavenProject.getProjectBuildingRequest()Lorg/apache/maven/project/ProjectBuildingRequest;
at hudson.maven.reporters.MavenFingerprinter.getLocalRepository(MavenFingerprinter.java:162)
at hudson.maven.reporters.MavenFingerprinter.recordParents(MavenFingerprinter.java:142)
at hudson.maven.reporters.MavenFingerprinter.postBuild(MavenFingerprinter.java:110)
at hudson.maven.Maven3Builder$MavenExecutionListener.recordProjectEnded(Maven3Builder.java:555)
at hudson.maven.Maven3Builder$MavenExecutionListener.projectFailed(Maven3Builder.java:542)
at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:71)
at org.apache.maven.lifecycle.internal.BuilderCommon.handleBuildError(BuilderCommon.java:137)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:95)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:314)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:151)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117)
... 21 more
ERROR: Failed to parse POMs
channel stopped
java.io.IOException: java.lang.reflect.InvocationTargetException
at hudson.maven.Maven3Builder.call(Maven3Builder.java:179)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
at ......remote call to Channel to Maven [java, -cp, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.12-alpha-1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5/boot/plexus-classworlds-2.2.3.jar, org.jvnet.hudson.maven3.agent.Maven3Main, /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5, /var/cache/jenkins/war/WEB-INF/lib/remoting-3.7.jar, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.12-alpha-1.jar, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12-alpha-1.jar, 33072](Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
at hudson.remoting.Channel.call(Channel.java:830)
at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:161)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:879)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:490)
at hudson.model.Run.execute(Run.java:1735)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:405)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:184)
... 14 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:181)
... 14 more
Caused by: java.lang.NoSuchMethodError: org.apache.maven.project.MavenProject.getProjectBuildingRequest()Lorg/apache/maven/project/ProjectBuildingRequest;
at hudson.maven.reporters.MavenFingerprinter.getLocalRepository(MavenFingerprinter.java:162)
at hudson.maven.reporters.MavenFingerprinter.recordParents(MavenFingerprinter.java:142)
at hudson.maven.reporters.MavenFingerprinter.postBuild(MavenFingerprinter.java:110)
at hudson.maven.Maven3Builder$MavenExecutionListener.recordProjectEnded(Maven3Builder.java:555)
at hudson.maven.Maven3Builder$MavenExecutionListener.projectFailed(Maven3Builder.java:542)
at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:71)
at org.apache.maven.lifecycle.internal.BuilderCommon.handleBuildError(BuilderCommon.java:137)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:95)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:314)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:151)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117)
... 21 more
Finished: FAILURE
My jenkin's version is 2.6 and I am this is the maven project of jenkins Any help regarding this will be very helpful to me
I found many reference to this issue, it looks like that updating the Maven version to Maven 3.0.4 fixes the issue..
Reference: https://groups.google.com/forum/#!topic/jenkinsci-users/-IzGYBryfkM
I solved this error by updating my jenkins and removing this from my maven:
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/package.xml</descriptor>
</descriptors>
</configuration>
because jenkins was unable to find package.xml at that location of my code.

Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.19.0:test (default-test) : No test Found

I am able to execute mvn clean install from maven repository on my machine.
But via jenkin, I get following error:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.19.0:test (default-test): No tests found.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: No tests found.
at org.eclipse.tycho.surefire.TestMojo.runTest(TestMojo.java:955)
at org.eclipse.tycho.surefire.TestMojo.execute(TestMojo.java:668)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
`
What is going wrong here?

SonarQube : NoSuchMethodError Surefire plugin

When I add the plugin sonar-surefire-plugin in my sonar (sonar v4.5.1 / surefire v3.3), when I run an analysis, I get the following error :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project XXXXXXX: org.sonar.plugins.surefire.api.SurefireUtils.getReportsDirectory(Lorg/sonar/api/config/Settings;Lorg/sonar/api/resources/Project;)Ljava/io/File;
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.NoSuchMethodError: org.sonar.plugins.surefire.api.SurefireUtils.getReportsDirectory(Lorg/sonar/api/config/Settings;Lorg/sonar/api/resources/Project;)Ljava/io/File;
... 22 more
Do you know why ?
Thanks !
As you can see on the Java Plugin page (in the warning box), the Surefire plugin has been merged into the Java plugin so just remove it from your SonarQube instance.

sonarqube jacoco and cobertura coverage on the same project

I am using sonarqube 5.0. In my project I would like to use cobertura, to generate coverage data to my unit tests, and jacoco to genarate data from the integration tests. Is it possible?
When I run sonar:sonar in my project I get the following error:
Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project sor: Can not add the same measure twice on org.sonar.api.resources.File#220b0a0e[key=src/main/java/business/permission/PermissionManagerBean.java,deprecatedKey=business.permission.PermissionManagerBean,path=src/main/java/business/permission/PermissionManagerBean.java,dir=business/permission,filename=PermissionManagerBean.java,language=Java]: org.sonar.api.measures.Measure#46d9cb65[metricKey=lines_to_cover,metric=Metric[id=38,key=lines_to_cover,description=Lines to cover,type=INT,direction=1,domain=<null>,name=lines_to_cover,qualitative=false,userManaged=false,enabled=true,origin=JAV,worstValue=<null>,bestValue=<null>,optimizedBestValue=false,hidden=false,deleteHistoricalData=false],value=70.0,data=<null>,description=<null>,alertStatus=<null>,alertText=<null>,tendency=<null>,date=<null>,variation1=<null>,variation2=<null>,variation3=<null>,variation4=<null>,variation5=<null>,url=<null>,characteristic=<null>,requirement=<null>,personId=<null>,persistenceMode=FULL,fromCore=false] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project sor: Can not add the same measure twice on org.sonar.api.resources.File#220b0a0e[key=src/main/java/business/permission/PermissionManagerBean.java,deprecatedKey=.business.permission.PermissionManagerBean,path=src/main/java/business/permission/PermissionManagerBean.java,dir=br/com/sor/business/permission,filename=PermissionManagerBean.java,language=Java]: org.sonar.api.measures.Measure#46d9cb65[metricKey=lines_to_cover,metric=Metric[id=38,key=lines_to_cover,description=Lines to cover,type=INT,direction=1,domain=<null>,name=lines_to_cover,qualitative=false,userManaged=false,enabled=true,origin=JAV,worstValue=<null>,bestValue=<null>,optimizedBestValue=false,hidden=false,deleteHistoricalData=false],value=70.0,data=<null>,description=<null>,alertStatus=<null>,alertText=<null>,tendency=<null>,date=<null>,variation1=<null>,variation2=<null>,variation3=<null>,variation4=<null>,variation5=<null>,url=<null>,characteristic=<null>,requirement=<null>,personId=<null>,persistenceMode=FULL,fromCore=false]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not add the same measure twice on org.sonar.api.resources.File#220b0a0e[key=src/main/java/business/permission/PermissionManagerBean.java,deprecatedKey=.business.permission.PermissionManagerBean,path=src/main/java/business/permission/PermissionManagerBean.java,dir=br/com/sor/business/permission,filename=PermissionManagerBean.java,language=Java]: org.sonar.api.measures.Measure#46d9cb65[metricKey=lines_to_cover,metric=Metric[id=38,key=lines_to_cover,description=Lines to cover,type=INT,direction=1,domain=<null>,name=lines_to_cover,qualitative=false,userManaged=false,enabled=true,origin=JAV,worstValue=<null>,bestValue=<null>,optimizedBestValue=false,hidden=false,deleteHistoricalData=false],value=70.0,data=<null>,description=<null>,alertStatus=<null>,alertText=<null>,tendency=<null>,date=<null>,variation1=<null>,variation2=<null>,variation3=<null>,variation4=<null>,variation5=<null>,url=<null>,characteristic=<null>,requirement=<null>,personId=<null>,persistenceMode=FULL,fromCore=false]
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:138)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.sonar.api.utils.SonarException: Can not add the same measure twice on org.sonar.api.resources.File#220b0a0e[key=src/main/java/business/permission/PermissionManagerBean.java,deprecatedKey=.business.permission.PermissionManagerBean,path=src/main/java/business/permission/PermissionManagerBean.java,dir=br/com/sor/business/permission,filename=PermissionManagerBean.java,language=Java]: org.sonar.api.measures.Measure#46d9cb65[metricKey=lines_to_cover,metric=Metric[id=38,key=lines_to_cover,description=Lines to cover,type=INT,direction=1,domain=<null>,name=lines_to_cover,qualitative=false,userManaged=false,enabled=true,origin=JAV,worstValue=<null>,bestValue=<null>,optimizedBestValue=false,hidden=false,deleteHistoricalData=false],value=70.0,data=<null>,description=<null>,alertStatus=<null>,alertText=<null>,tendency=<null>,date=<null>,variation1=<null>,variation2=<null>,variation3=<null>,variation4=<null>,variation5=<null>,url=<null>,characteristic=<null>,requirement=<null>,personId=<null>,persistenceMode=FULL,fromCore=false]
at org.sonar.batch.index.DefaultIndex.addMeasure(DefaultIndex.java:226)
at org.sonar.batch.DefaultSensorContext.saveMeasure(DefaultSensorContext.java:177)
at org.sonar.plugins.jacoco.JaCoCoSensor$UnitTestsAnalyzer.saveMeasures(JaCoCoSensor.java:93)
at org.sonar.plugins.jacoco.AbstractAnalyzer.readExecutionData(AbstractAnalyzer.java:172)
at org.sonar.plugins.jacoco.AbstractAnalyzer.analyse(AbstractAnalyzer.java:120)
at org.sonar.plugins.jacoco.JaCoCoSensor.analyse(JaCoCoSensor.java:66)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:122)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:222)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:223)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:52)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:128)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:171)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135)
... 22 more

Resources