Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) Incompatible execution data for class - sonarqube

this is the sonar additional properties configured in jenkins coverage job:
-Dsonar.jacoco.reportPath=${WORKSPACE}/merged_unit.exec
-Dsonar.java.coveragePlugin=jacoco
-Dsonar.dynamicAnalysis=reuseReports
-Dsonar.jacoco.itReportPath=${WORKSPACE}/merged_it.exec
i am getting the error below on jenkins :
Jenkins Log: [ERROR] Failed to execute goal
org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar
(default-cli) on project aaaa-parent: Incompatible execution data for
class xxxxxxxxxxxxx with id 4050af3ab5fc5456. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal
org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar
(default-cli) on project xxxxx: Incompatible execution data for class
xxxxxxxxxxxxxxxxxx with id 4050af3ab5fc5456. 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:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at
org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) at
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:197) 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)
the strange thing is that, if i set the reportPath and itReportPath the same, no matter merged_unit.exec or merged_it.exec, the sonar analysis goes well
but if i set what it should be , the error comes up .
the project is a muti-modules one, so i use the xml below to merge (i only put one module first for testing)
<target name="merge_unit_exec">
<jacoco:merge destfile="/home/qatest/test-script/aaa/unittest/report/merged_unit.exec">
<fileset dir="/home/qatest/jenkins/workspace/aaaa/aaa/target" includes="*.exec" />
</jacoco:merge>
</target>
it blocks me 2days, really appreciate for your great help., thank you

Incompatible execution data for class means that execution data contains exact same class twice, but with a different number of probes.
So check that you use exact same latest JaCoCo version everywhere. Check that you don't have stale exec files to which you append data, while they were created with another version of JaCoCo. Check that you don't have non-graceful termination of JVM that might result in incomplete corrupted exec files.
Check similar questions about same exception in “IllegalStateException: Incompatible execution data for class in…” exception from Jacoco when run for an existing ear and https://github.com/jacoco/jacoco/issues/95

-Dsonar.jacoco.reportPath=${WORKSPACE}/merged_unit.exec
-Dsonar.jacoco.itReportPath=${WORKSPACE}/merged_it.exec
-Dsonar.java.coveragePlugin=jacoco
-Dsonar.dynamicAnalysis=reuseReports
i found the solution above, but who can give a reasonable answer of that

Related

Passing test class to be run as a parameter to Maven -Dtest

I have 2 test classes in my project that I want to run through jenkins, each with a particular profile (because they have different set of dependencies). I tried to create a parameter "Class_To-Run" which will have the name of class to be run in the pre-steps and then executed project as:
mvn clean compile test -Dtest=$Class_To_Run -P profileUsed
which throws the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project SparkTest: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.)
However, if a specify the name of the class to be run in the command itself (-Dtest=ClassName), the project runs successfully. Am I committing some mistake? How do I make it parameterised?
Following is the log after build fails:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project SparkTest: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project SparkTest: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.)
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: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:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
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:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.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:207)
at hudson.remoting.UserRequest.perform(UserRequest.java:53)
at hudson.remoting.Request$2.run(Request.java:358)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoFailureException: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:847)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 31 more
Finally, I figured it out. As I said in comments above that the variable ("Class_To_Run") was not being expanded to its value while the maven command was being executed by jenkins. The problem was that I had declared the variable in execute shell part in Pre Steps of jenkins job configuration. The parameters that you create in the general step of jenkins job are only accessible in the build step.

Maven: Error putting Weblogic libs into local repository

I want to put Weblogic libs into local repository (Installing and Configuring Maven for Build Automation and Dependency Management) I have the Weblogic version is 12.1.2 installed in my workstation.
I run this command:
mvn -X com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=C:\Oracle\product\11.2.0\client_x86 -Doracle-maven-sync.testingOnly=false
but I got this error:
[ERROR] Failed to execute goal com.oracle.maven:oracle-maven-sync:12.2.1-2-0:push (default-cli) on project standalone-pom: Synchronization execution failed:
No resources were processed by the sync plugin -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.oracle.maven:oracle-maven-sync:12.2.1-2-0:push (default-cli)
on project standalone-pom: Synchronization execution failed
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:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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.MojoExecutionException: Synchronization execution failed
at com.oracle.maven.sync.ODMPushMojo.execute(ODMPushMojo.java:242)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: com.oracle.maven.sync.SyncException: No resources were processed by the sync plugin
at com.oracle.maven.sync.ODMPusher.handleError(ODMPusher.java:458)
at com.oracle.maven.sync.ODMPusher.push(ODMPusher.java:117)
at com.oracle.maven.sync.ODMPushMojo.execute(ODMPushMojo.java:240)
... 22 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
C:\Users\carbonell>
This may be an old thread, but the answer may still help somebody
Cause:
Issue was happening due to wrong variable -Doracle-maven-sync.oracleHome
Solution:
Please change the flag to -DoracleHome:
mvn -X com.oracle.maven:oracle-maven-sync:push -DoracleHome="your Oracle home dir" -Doracle-maven-sync.testingOnly=false
Your ORACLE_HOME points to the Oracle data base driver. I think you need to point it to the Oracle Middleware (aka Weblogic) directory.
Check that you refer to weblogic's libraries from maven as a dependency in the following way:
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-server-pom</artifactId>
<version>12.1.2-0-0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Then, you must try this, from this reference:
mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=%MW_HOME% -Doracle-maven-sync.testingOnly=false
If nothing works, see also this very related issue

setup a Maven Wrapper for my project with io.takari

I want to setup the Maven Wrapper (The Maven Wrapper is an easy way to ensure a user of your Maven build has everything necessary to run your Maven build) for my project.
I will use the Takari Maven Plugin with its provided wrapper goal.
I execute the following command:
mvn -N io.takari:maven:wrapper
But I got this error
[ERROR] Failed to execute goal io.takari:maven:0.4.1:wrapper (default-cli) on project standalone-pom: Error installing the maven-wrapper archive. Cannot determine the type of archive C:\Users\carbonell\.m2\repository\io\takari\maven-wrapper\0.2.1\maven-wrapper-0.2.1.tar.gz. Input is not in the .gz for
mat -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.takari:maven:0.4.1:wrapper (default-cli) on project standalone-pom: Error installing the maven-wrapper archive.
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:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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.MojoExecutionException: Error installing the maven-wrapper archive.
at io.takari.maven.plugins.WrapperMojo.execute(WrapperMojo.java:67)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: java.lang.RuntimeException: Cannot determine the type of archive C:\Users\carbonell\.m2\repository\io\takari\maven-wrapper\0.2.1\maven-wrapper-0.2.1.tar.gz.
at io.tesla.proviso.archive.tar.TarGzArchiveSource.<init>(TarGzArchiveSource.java:29)
at io.tesla.proviso.archive.tar.TarGzArchiveHandler.getArchiveSource(TarGzArchiveHandler.java:44)
at io.tesla.proviso.archive.UnArchiver.unarchive(UnArchiver.java:54)
at io.tesla.proviso.archive.UnArchiver.unarchive(UnArchiver.java:44)
at io.takari.maven.plugins.WrapperMojo.execute(WrapperMojo.java:60)
... 22 more
Caused by: java.io.IOException: Input is not in the .gz format
at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.init(GzipCompressorInputStream.java:164)
at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.<init>(GzipCompressorInputStream.java:137)
at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.<init>(GzipCompressorInputStream.java:102)
at io.tesla.proviso.archive.tar.TarGzArchiveHandler.getInputStream(TarGzArchiveHandler.java:34)
at io.tesla.proviso.archive.tar.TarGzArchiveSource.<init>(TarGzArchiveSource.java:27)
... 26 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Answering this for posterity.
I got this on my second attempt to run this goal.
The first attempt failed with "Unsupported or unrecognized SSL message" because Maven couldn't get through my company proxy. I don't know why or how it was bypassing our internal repository configured in settings.xml. This left me with an empty gzip file at the location specified in that error message.
The second attempt produced the same error you received because the gzip file was empty.
I had to cheat a little and configure Maven via MAVEN_OPTS to use the proxy in order to download all of the necessary artifacts.

sonar design plugin unsatisfied dependency

I have recently upgraded to SonarQube 5.1.2 and have added the "design" plugin that I used to have in my old 3.2 instance.
This is my list of installed plugins:
cobertura,false,sonar-cobertura-plugin-1.6.3.jar|3ea2c0afe6e6b9701e4d5c8af382d388
emailnotifications,true,sonar-email-notifications-plugin-5.1.2.jar|3dd4e623752556c7a8757c1989af0ece
python,false,sonar-python-plugin-1.5.jar|268d44b47786147ef51376215c6c230a
crowd,false,sonar-crowd-plugin-2.0.jar|f580d366b948f01071317ef28bb60da1
pmd,false,sonar-pmd-plugin-2.4.1.jar|ff3781c9788d4e83f60e83bbd3d12e10
motionchart,false,sonar-motion-chart-plugin-1.7.jar|bdb198c2207ef033d6f1ee3e3eaea2b1
scmsvn,false,sonar-scm-svn-plugin-1.0.jar|6915a69a7810c2b33ad4276d99a23077
javascript,false,sonar-javascript-plugin-2.8.jar|0f87170f4cec0f7fc51b6572530153f9
core,true,sonar-core-plugin-5.1.2.jar|b86ec05f4953608b2b4b697c027ab994
csharp,false,sonar-csharp-plugin-4.2.jar|af49378c5127353a2536ae77159ddbbb
buildstability,false,sonar-build-stability-plugin-1.3.jar|efc9f452c6fa20e268b6f1bb974d8e93
findbugs,false,sonar-findbugs-plugin-3.3.jar|f89994727607c7aacbea6e9396fed153
groovy,false,sonar-groovy-plugin-1.2.jar|14908dd5f3a9b9d795dbc103f0af546f
java,false,sonar-java-plugin-3.5.jar|64ff984b1b847bb6089cdda940ac0483
web,false,sonar-web-plugin-2.4.jar|1dbfc63768da3d753a61eda6146a8f7b
scmgit,false,sonar-scm-git-plugin-1.0.jar|e1d9d8e1d3524f9f0f69017e6dbead02
design,false,sonar-design-plugin-4.5.6.jar|6858390fab9e7e9e781bd17a837e32ce
scmstats,false,sonar-scm-stats-plugin-0.3.1.jar|79b6807b2bc2fe5d0607c37557ceb2be
timeline,false,sonar-timeline-plugin-1.5.jar|bbd6b21fb738281b5dd42e793d01bb5f
php,false,sonar-php-plugin-2.6.jar|5e37936c012cca253006867af1748793
l10nen,true,sonar-l10n-en-plugin-5.1.2.jar|bb21d03934050deec6cc95d0063d7789
checkstyle,false,sonar-checkstyle-plugin-2.3.jar|9c90929f5f058f6372f0f2346ab0d3ed
jira,false,sonar-jira-plugin-1.2.jar|0e68329678d4706d2d98e0f08fd5306e
I'm getting this error while trying to run mvn clean verify sonar:sonar on a project that used to work with old Sonar version.
It also works OK when I exclude that design plugin:
-Dsonar.excudePlugins=design
Any idea on how to fix this?
Thanks in advance.
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project myproject: org.sonar.plugins.design.batch.MavenDependenciesSensor has unsatisfied dependency 'interface org.apache.maven.shared.dependency.tree.DependencyTreeBuilder' for constructor 'public org.sonar.plugins.design.batch.MavenDependenciesSensor(org.apache.maven.artifact.repository.ArtifactRepository,org.apache.maven.artifact.factory.ArtifactFactory,org.apache.maven.artifact.metadata.ArtifactMetadataSource,org.apache.maven.artifact.resolver.ArtifactCollector,org.apache.maven.shared.dependency.tree.DependencyTreeBuilder,org.sonar.api.batch.SonarIndex)' from org.picocontainer.DefaultPicoContainer#232af575:310<[Immutable]:org.picocontainer.DefaultPicoContainer#5177d2af:252<[Immutable]:org.picocontainer.DefaultPicoContainer#4f265869:23<[Immutable]:org.picocontainer.DefaultPicoContainer#6760353c:107<| -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project myproject: org.sonar.plugins.design.batch.MavenDependenciesSensor has unsatisfied dependency 'interface org.apache.maven.shared.dependency.tree.DependencyTreeBuilder' for constructor 'public org.sonar.plugins.design.batch.MavenDependenciesSensor(org.apache.maven.artifact.repository.ArtifactRepository,org.apache.maven.artifact.factory.ArtifactFactory,org.apache.maven.artifact.metadata.ArtifactMetadataSource,org.apache.maven.artifact.resolver.ArtifactCollector,org.apache.maven.shared.dependency.tree.DependencyTreeBuilder,org.sonar.api.batch.SonarIndex)' from org.picocontainer.DefaultPicoContainer#232af575:310<[Immutable]:org.picocontainer.DefaultPicoContainer#5177d2af:252<[Immutable]:org.picocontainer.DefaultPicoContainer#4f265869:23<[Immutable]:org.picocontainer.DefaultPicoContainer#6760353c:107<|
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:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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: org.sonar.plugins.design.batch.MavenDependenciesSensor has unsatisfied dependency 'interface org.apache.maven.shared.dependency.tree.DependencyTreeBuilder' for constructor 'public org.sonar.plugins.design.batch.MavenDependenciesSensor(org.apache.maven.artifact.repository.ArtifactRepository,org.apache.maven.artifact.factory.ArtifactFactory,org.apache.maven.artifact.metadata.ArtifactMetadataSource,org.apache.maven.artifact.resolver.ArtifactCollector,org.apache.maven.shared.dependency.tree.DependencyTreeBuilder,org.sonar.api.batch.SonarIndex)' from org.picocontainer.DefaultPicoContainer#232af575:310<[Immutable]:org.picocontainer.DefaultPicoContainer#5177d2af:252<[Immutable]:org.picocontainer.DefaultPicoContainer#4f265869:23<[Immutable]:org.picocontainer.DefaultPicoContainer#6760353c:107<|
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:132)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
For now the last available version of the SonarQube Design Plugin is 4.5.6.
Plugin pom.xml file contains text
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
<version>4.5.6</version>
<relativePath>../..</relativePath>
</parent>
which mean that this plugin is compatible with SonarQube 4.5.6 LTS. So unfortunately you cannot use this plugin with SonarQube 5.2.

How do I fix a "Unexpected end of ZLIB input stream" with the Maven shade plugin?

When running the Maven Shade plugin, I get the following error. How can I debug this?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.0:shade (make-shade) on project csprocessor-client: Error creating shaded jar: Unexpected end of ZLIB input stream -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.0:shade (make-shade) on project csprocessor-client: Error creating shaded jar: Unexpected end of ZLIB input stream
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:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating shaded jar: Unexpected end of ZLIB input stream
at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:551)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:411)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:188)
at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:174)
at org.apache.maven.plugins.shade.DefaultShader.addRemappedClass(DefaultShader.java:259)
at org.apache.maven.plugins.shade.DefaultShader.shade(DefaultShader.java:151)
at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:484)
... 21 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
It turns out that with the m2eclipse plugin, you can actually debug a maven plugin as it is executing. To do this you need to what code you want to step into, which you can do by setting the Debug Output option in the Maven Run Configuration. You'll also need to set the Resolve Workspace artifacts option.
With these two options I could click the file location listed in the error (ZipFile.java:411 in this case), set a break point, and use Debug As > Maven Build to run the Maven build in debug mode. Once the breakpoint was hit I could tell which file was causing the error, and repackage it using the JAR command. Even though the JAR file in question could be opened with a GUI archive tool, once repackaged with the JAR command I could successfully run the Maven Shade plgin.
FYI, if this was caused by a JAR that was corrupted during download, a quick way of forcing a re-download is to run mvn dependency:purge-local-repository in the shading project. This removes all dependencies (direct and transitive) of the project from the local Maven repository and downloads them anew.

Resources