Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SevNTU Checkstyle Sonar plugin should not bundle Checkstyle library #746

Closed
KTannenberg opened this issue May 18, 2019 · 19 comments

Comments

@KTannenberg
Copy link
Contributor

commented May 18, 2019

Steps to reproduce:

  1. Install and start SonarQube 7.7, e.g. to /opt/sonar/
  2. Navigate to administration page and install Checkstyle plugin (4.20 at the time of writing)
  3. Download SevNTU Checkstyle plugin for Sonar 1.33.0 and save it to extensions/plugins of your Sonar installation
  4. Restart Sonar
  5. Go to http://localhost:9000/admin/settings?category=java and specify some value in Tab Width
  6. In any project start sonar analysis

Expected: analysis completes successfully

Observed: analysis fails because checkstyle 8.18 (bundled with SevNTU plugin for Sonar 1.33.0) overrides checkstyle 8.20 (bundled with Checkstyle plugin for Sonar 4.20) on execution classpath

Stacktrace

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project basics-parent: Can not execute Checkstyle: Property 'tabWidth' does not exist, please check the documentation -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project basics-parent: Can not execute Checkstyle
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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 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 execute Checkstyle
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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 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.IllegalStateException: Can not execute Checkstyle
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.executeWithClassLoader (CheckstyleExecutor.java:118)
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute (CheckstyleExecutor.java:85)
    at org.sonar.plugins.checkstyle.CheckstyleSensor.execute (CheckstyleSensor.java:42)
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse (AbstractSensorWrapper.java:48)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:85)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1 (ModuleSensorsExecutor.java:59)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:59)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:359)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:354)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:351)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:317)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:128)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:73)
    at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:67)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
    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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy24.execute (Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:185)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:137)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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 org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property 'tabWidth' does not exist, please check the documentation
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.tryCopyProperty (AutomaticBean.java:223)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure (AutomaticBean.java:191)
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.executeWithClassLoader (CheckstyleExecutor.java:110)
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute (CheckstyleExecutor.java:85)
    at org.sonar.plugins.checkstyle.CheckstyleSensor.execute (CheckstyleSensor.java:42)
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse (AbstractSensorWrapper.java:48)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:85)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1 (ModuleSensorsExecutor.java:59)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:59)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:359)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:354)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:351)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:317)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:128)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:73)
    at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:67)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
    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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy24.execute (Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:185)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:137)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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 org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR] 


Workaround: repack SevNTU plugin without libraries that are already included in main Checksyle plugin

Notes:

  1. Problems doesn't reproduce on Sonar 6.7.1 & 6.7.7 but this is likely due to order of plugins as they get added to classpath
  2. Similar issue likely exists with other dependencies of SevNTU plugin as some dependencies overlap with main Checkstyle plugin:
[sb@i-sonar01 plugins]$ zipinfo sevntu-checkstyle-sonar-plugin-1.33.0.jar | grep 'lib/.*jar'
-rw----     2.0 fat   337904 bl defN 19-Mar-25 07:33 META-INF/lib/antlr4-runtime-4.7.2.jar
-rw----     2.0 fat  5477882 bl defN 19-Mar-25 07:33 META-INF/lib/Saxon-HE-9.9.1-1.jar
-rw----     2.0 fat  2172168 bl defN 19-Mar-25 07:33 META-INF/lib/guava-15.0.jar
-rw----     2.0 fat   445288 bl defN 19-Mar-25 07:33 META-INF/lib/antlr-2.7.7.jar
-rw----     2.0 fat    61829 bl defN 19-Mar-25 07:33 META-INF/lib/commons-logging-1.2.jar
-rw----     2.0 fat   179833 bl defN 19-Mar-25 07:33 META-INF/lib/sevntu-checks-1.33.0.jar
-rw----     2.0 fat   263011 bl defN 19-Mar-25 07:33 META-INF/lib/picocli-3.9.5.jar
-rw----     2.0 fat  1315257 bl defN 19-Mar-25 07:33 META-INF/lib/checkstyle-8.18.jar
[sb@i-sonar01 plugins]$ zipinfo checkstyle-sonar-plugin-4.20.jar | grep 'lib/.*jar'
-rw-rw-r--  2.0 unx   337904 b- defN 19-May-14 05:37 META-INF/lib/antlr4-runtime-4.7.2.jar
-rw-rw-r--  2.0 unx    33015 b- defN 19-May-14 05:37 META-INF/lib/jsr305-1.3.9.jar
-rw-rw-r--  2.0 unx  2746650 b- defN 19-May-14 05:37 META-INF/lib/guava-27.0.1-jre.jar
-rw-rw-r--  2.0 unx   323669 b- defN 19-May-14 05:37 META-INF/lib/picocontainer-2.14.1.jar
-rw-rw-r--  2.0 unx    13694 b- defN 19-May-14 05:37 META-INF/lib/error_prone_annotations-2.2.0.jar
-rw-rw-r--  2.0 unx     2199 b- defN 19-May-14 05:37 META-INF/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
-rw-rw-r--  2.0 unx   445288 b- defN 19-May-14 05:37 META-INF/lib/antlr-2.7.7.jar
-rw-rw-r--  2.0 unx   284220 b- defN 19-May-14 05:37 META-INF/lib/commons-lang-2.6.jar
-rw-rw-r--  2.0 unx     4617 b- defN 19-May-14 05:37 META-INF/lib/failureaccess-1.0.1.jar
-rw-rw-r--  2.0 unx   208700 b- defN 19-May-14 05:37 META-INF/lib/commons-io-2.5.jar
-rw-rw-r--  2.0 unx  5484426 b- defN 19-May-14 05:37 META-INF/lib/Saxon-HE-9.9.1-2.jar
-rw-rw-r--  2.0 unx  1319349 b- defN 19-May-14 05:37 META-INF/lib/checkstyle-8.20.jar
-rw-rw-r--  2.0 unx     3448 b- defN 19-May-14 05:37 META-INF/lib/animal-sniffer-annotations-1.17.jar
-rw-rw-r--  2.0 unx   264889 b- defN 19-May-14 05:37 META-INF/lib/picocli-3.9.6.jar
-rw-rw-r--  2.0 unx    26989 b- defN 19-May-14 05:37 META-INF/lib/sslr-squid-bridge-2.7.0.377.jar
-rw-rw-r--  2.0 unx    22338 b- defN 19-May-14 05:37 META-INF/lib/slf4j-api-1.5.6.jar
-rw-rw-r--  2.0 unx   246174 b- defN 19-May-14 05:37 META-INF/lib/commons-beanutils-1.9.3.jar
-rw-rw-r--  2.0 unx     8782 b- defN 19-May-14 05:37 META-INF/lib/j2objc-annotations-1.1.jar
-rw-rw-r--  2.0 unx   588337 b- defN 19-May-14 05:37 META-INF/lib/commons-collections-3.2.2.jar
-rw-rw-r--  2.0 unx   193322 b- defN 19-May-14 05:37 META-INF/lib/checker-qual-2.5.2.jar
-rw-rw-r--  2.0 unx 12624117 b- defN 19-May-14 05:37 META-INF/lib/icu4j-63.1.jar

@romani romani added the approved label Jun 16, 2019

@romani

This comment has been minimized.

Copy link
Member

commented Jun 16, 2019

@KTannenberg , thanks a lot for detailed report.
FYI:
https://checkstyle.org/releasenotes.html#Release_8.21 introduced big break change in API, so all extensions need to be recompiled. So your workaround might not work on 8.21.
But it is so rare case, that we break API that heavy.

@rdiachenko , do you have time to help us to fix this issue ?
Shade plugin is used - https://github.com/sevntu-checkstyle/sevntu.checkstyle/blob/master/sevntu-checkstyle-sonar-plugin/pom.xml#L139
we probably can remove it .... but we need to test it.

FYI:
Unfortunately senvtu project can not update to latest checkstyle binaries, as sevntu depends on eclipse-cs, and eclipse-cs lacks maintainers, they cannot keep up with checktyle releases.

@rdiachenko

This comment has been minimized.

Copy link
Member

commented Jun 16, 2019

@romani I'll be able to take a look in a week or so. If ok, please assign to me.

@romani

This comment has been minimized.

Copy link
Member

commented Jun 16, 2019

You are not in list of possible assignee.
Issue is all yours, thanks a lot for help.

@rdiachenko

This comment has been minimized.

Copy link
Member

commented Jun 30, 2019

Update:
Removal of shade plugin doesn't help. checkstyle-8.18 comes transitively from sevntu-checks. What helps is explicit exclusion of the transitive dependency:

sevntu.checkstyle/sevntu-checkstyle-sonar-plugin [issue-746 L|✚ 1] $ git diff pom.xml
diff --git a/sevntu-checkstyle-sonar-plugin/pom.xml b/sevntu-checkstyle-sonar-plugin/pom.xml
index c649334c..84e2b24e 100644
--- a/sevntu-checkstyle-sonar-plugin/pom.xml
+++ b/sevntu-checkstyle-sonar-plugin/pom.xml
@@ -41,6 +41,12 @@
       <groupId>com.github.sevntu-checkstyle</groupId>
       <artifactId>sevntu-checks</artifactId>
       <version>${project.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>com.puppycrawl.tools</groupId>
+          <artifactId>checkstyle</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>

It works with checkstyle sonar plugin 4.20 (comes with checkstyle 8.20) and it doesn't work with 4.21 (comes with checkstyle 8.21) as @romani mentioned above.

@rnveach

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

@rdiachenko If you remove checkstyle from sevntu-sonar, doesn't that mean sevntu-sonar and checkstyle-sonar must both be installed for sevntu-sonar to work?

analysis fails because checkstyle 8.18 (bundled with SevNTU plugin for Sonar 1.33.0) overrides checkstyle 8.20 (bundled with Checkstyle plugin for Sonar 4.20) on execution classpath

This seems like the real problem, not removing checkstyle from sevntu-sonar.
For sevntu and checkstyle to work together, sevntu must use the same version as checkstyle that it was made for. If you don't use the same version for both, you will experience weird issues. This is why sevntu must use the same checkstyle version as eclipse-cs, because eclipse-cs integrates that version of checkstyle into itself.

@romani

This comment has been minimized.

Copy link
Member

commented Jul 1, 2019

doesn't that mean sevntu-sonar and checkstyle-sonar must both be installed for sevntu-sonar to work?

I think it is reasonable to expect this. This probably required even right now. @rdiachenko , please confirm.

sevntu must use the same version as checkstyle that it was made for.

yes and no. If we say yes - so we need to release it as frequent as checkstyle is released.
If no - we just define till what version it works. The same as we have with maven plugin, you can use not all latest versions of checkstyle by override in dependency.

because eclipse-cs integrates that version of checkstyle into itself.

eclipse-cs is lack of support, hard dependency to of sevntu to eclipse-cs is pure history, originally whole project were eclipse-cs extension only. Now we need to cut this dependency as it blocks us. eclipsecs-sevntu-plugin can be detached from common version to not block others (and come back to common version when eclipse-cs is updated).

@rdiachenko

This comment has been minimized.

Copy link
Member

commented Jul 1, 2019

If you remove checkstyle from sevntu-sonar, doesn't that mean sevntu-sonar and checkstyle-sonar must both be installed for sevntu-sonar to work?

I think it is reasonable to expect this. This probably required even right now. @rdiachenko , please confirm.

@rnveach, sevntu-sonar is just an extension to the main checkstyle plugin and can not work without it. You may copy sevntu-sonar jar into sonarqube/extensions/plugins/ without installing the main checkstyle plugin and sonarqube starts successfully but you won't be able to use sevntu-sonar, sonarqube ignores it.

@rnveach

This comment has been minimized.

Copy link
Contributor

commented Jul 3, 2019

@romani

SevNTU Checkstyle Sonar plugin should not bundle Checkstyle

Why does sevntu-checks bundle checkstyle? It seems odd that sevntu-sonar plugin should not bundle it but normal sevntu-checks should.
In our own checkstyle documentation, we mention that 3rd party checks should be appended with main checkstyle jar, so I wouldn't expect others to also embed the checkstyle JAR.
See https://checkstyle.sourceforge.io/cmdline.html#Usage_by_Classpath_update

Run checkstyle with custom module(s) (Root module, Checks, etc) in configuration file:
java -classpath MyCustom.jar;checkstyle-8.22-all.jar

@romani

This comment has been minimized.

Copy link
Member

commented Jul 3, 2019

Let's remove bundling, it was not done on purpose, it is unnoticed side effect.
Let's try.

romani added a commit that referenced this issue Jul 3, 2019

@romani

This comment has been minimized.

Copy link
Member

commented Jul 3, 2019

@rdiachenko , can we try to remove checkstyle from sevntu-checks ?
Probably it is better to make separate issue on this, second PR for this issue is also ok

@rnveach

This comment has been minimized.

Copy link
Contributor

commented Jul 3, 2019

I made new issue.
I will close this as it is done.

@rnveach rnveach closed this Jul 3, 2019

@rnveach rnveach added the bug label Jul 3, 2019

@rnveach rnveach added this to the 1.35.0 milestone Jul 3, 2019

@romani

This comment has been minimized.

Copy link
Member

commented Jul 16, 2019

@KTannenberg , fix is released, please recheck that it works on your side.

@KTannenberg

This comment has been minimized.

Copy link
Contributor Author

commented Jul 18, 2019

@romani, seems dodgy:

[sb@i-sonar01 plugins]$ pwd
/opt/sonar/sonarqube/extensions/plugins

[sb@i-sonar01 plugins]$ rm sevntu-checkstyle-sonar-plugin-1.33.0*

[sb@i-sonar01 plugins]$ wget https://repo1.maven.org/maven2/com/github/sevntu-checkstyle/sevntu-checkstyle-sonar-plugin/1.34.1/sevntu-checkstyle-sonar-plugin-1.34.1.jar
--2019-07-18 07:22:19--  https://repo1.maven.org/maven2/com/github/sevntu-checkstyle/sevntu-checkstyle-sonar-plugin/1.34.1/sevntu-checkstyle-sonar-plugin-1.34.1.jar
Resolving repo1.maven.org (repo1.maven.org)... 199.232.36.209
Connecting to repo1.maven.org (repo1.maven.org)|199.232.36.209|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9495300 (9.1M) [application/java-archive]
Saving to: 'sevntu-checkstyle-sonar-plugin-1.34.1.jar'

100%[====================================================================================================================================================>] 9,495,300   11.8MB/s   in 0.8s   

2019-07-18 07:22:20 (11.8 MB/s) - 'sevntu-checkstyle-sonar-plugin-1.34.1.jar' saved [9495300/9495300]


[sb@i-sonar01 plugins]$ zipinfo sevntu-checkstyle-sonar-plugin-1.34.1.jar 
Archive:  sevntu-checkstyle-sonar-plugin-1.34.1.jar
Zip file size: 9495300 bytes, number of entries: 27
-rw----     2.0 fat        0 bX defN 19-Jun-22 08:01 META-INF/
-rw----     2.0 fat     1243 bl defN 19-Jun-22 08:01 META-INF/MANIFEST.MF
-rw----     2.0 fat        0 bl defN 19-Jun-22 08:01 com/
-rw----     2.0 fat        0 bl defN 19-Jun-22 08:01 com/github/
-rw----     2.0 fat        0 bl defN 19-Jun-22 08:01 com/github/sevntu/
-rw----     2.0 fat        0 bl defN 19-Jun-22 08:01 com/github/sevntu/checkstyle/
-rw----     2.0 fat        0 bl defN 19-Jun-22 08:01 com/github/sevntu/checkstyle/sonar/
-rw----     2.0 fat    53254 bl defN 19-Jun-22 08:01 com/github/sevntu/checkstyle/sonar/checkstyle-extensions.xml
-rw----     2.0 fat      701 bl defN 19-Jun-22 08:01 com/github/sevntu/checkstyle/sonar/CheckstyleExtensionPlugin.class
-rw----     2.0 fat     1570 bl defN 19-Jun-22 08:01 com/github/sevntu/checkstyle/sonar/CheckstyleExtensionRepository.class
-rw----     2.0 fat        0 bl defN 19-Jun-22 08:01 META-INF/lib/
-rw----     2.0 fat    38806 bl defN 19-Jun-22 08:01 META-INF/lib/annotations-3.0.1.jar
-rw----     2.0 fat   337904 bl defN 19-Jun-22 08:01 META-INF/lib/antlr4-runtime-4.7.2.jar
-rw----     2.0 fat  5477882 bl defN 19-Jun-22 08:01 META-INF/lib/Saxon-HE-9.9.1-1.jar
-rw----     2.0 fat   195742 bl defN 19-Jun-22 08:01 META-INF/lib/sevntu-checks-1.34.1.jar
-rw----     2.0 fat  2172168 bl defN 19-Jun-22 08:01 META-INF/lib/guava-15.0.jar
-rw----     2.0 fat   445288 bl defN 19-Jun-22 08:01 META-INF/lib/antlr-2.7.7.jar
-rw----     2.0 fat    61829 bl defN 19-Jun-22 08:01 META-INF/lib/commons-logging-1.2.jar
-rw----     2.0 fat     2254 bl defN 19-Jun-22 08:01 META-INF/lib/jcip-annotations-1.0.jar
-rw----     2.0 fat   263011 bl defN 19-Jun-22 08:01 META-INF/lib/picocli-3.9.5.jar
-rw----     2.0 fat  1315257 bl defN 19-Jun-22 08:01 META-INF/lib/checkstyle-8.18.jar
-rw----     2.0 fat    19936 bl defN 19-Jun-22 08:01 META-INF/lib/jsr305-3.0.2.jar
-rw----     2.0 fat        0 bl defN 19-Jun-22 08:01 META-INF/maven/
-rw----     2.0 fat        0 bl defN 19-Jun-22 08:01 META-INF/maven/com.github.sevntu-checkstyle/
-rw----     2.0 fat        0 bl defN 19-Jun-22 08:01 META-INF/maven/com.github.sevntu-checkstyle/sevntu-checkstyle-sonar-plugin/
-rw----     2.0 fat    11880 bl defN 19-Jun-22 08:01 META-INF/maven/com.github.sevntu-checkstyle/sevntu-checkstyle-sonar-plugin/pom.xml
-rw----     2.0 fat      144 bl defN 19-Jun-22 08:01 META-INF/maven/com.github.sevntu-checkstyle/sevntu-checkstyle-sonar-plugin/pom.properties
27 files, 10398869 bytes uncompressed, 9490786 bytes compressed:  8.7%

[sb@i-sonar01 plugins]$ 

All libraries are still present. Will give it a try, but likely it will fail again.

You may also want to do something about JSR305 annotations as this project is dead for quite some time and according to Oracle's BCL you cannot ship anything that modifies javax package (https://www.oracle.com/downloads/licenses/binary-code-license.html):

F. JAVA TECHNOLOGY RESTRICTIONS. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun", “oracle” or similar convention as specified by Oracle in any naming convention designation.

Other projects are removing JSR305 already, e.g. spotbugs/spotbugs#421 google/guava#2960 https://issues.apache.org/jira/browse/JCR-4301

@KTannenberg

This comment has been minimized.

Copy link
Contributor Author

commented Jul 18, 2019

@romani @rdiachenko, issue is still present:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project basics-parent: Can not execute Checkstyle: Property 'tabWidth' does not exist, please check the documentation -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project basics-parent: Can not execute Checkstyle
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Checkstyle
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalStateException: Can not execute Checkstyle
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.executeWithClassLoader (CheckstyleExecutor.java:118)
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute (CheckstyleExecutor.java:85)
    at org.sonar.plugins.checkstyle.CheckstyleSensor.execute (CheckstyleSensor.java:42)
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse (AbstractSensorWrapper.java:48)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:85)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1 (ModuleSensorsExecutor.java:59)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:59)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:359)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:354)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:351)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:317)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:128)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:73)
    at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:67)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
    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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy24.execute (Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:185)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:137)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property 'tabWidth' does not exist, please check the documentation
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.tryCopyProperty (AutomaticBean.java:223)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure (AutomaticBean.java:191)
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.executeWithClassLoader (CheckstyleExecutor.java:110)
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute (CheckstyleExecutor.java:85)
    at org.sonar.plugins.checkstyle.CheckstyleSensor.execute (CheckstyleSensor.java:42)
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse (AbstractSensorWrapper.java:48)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:85)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1 (ModuleSensorsExecutor.java:59)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:59)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:359)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:354)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:351)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:317)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:128)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:73)
    at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:67)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
    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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy24.execute (Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:185)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:137)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[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
[ERROR][sonar] Exception during goal execution: Command 'mvn $MAVEN_ARGS -e -V -U sonar:sonar -Dsonar.branch.name="#746"' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/home/agrigorov/hydra/basics/.ci/ci-scripts/wrapper.py", line 369, in <module>
    main()
  File "/home/agrigorov/hydra/basics/.ci/ci-scripts/wrapper.py", line 365, in main
    execute_goals(goals, args, extra)
  File "/home/agrigorov/hydra/basics/.ci/ci-scripts/wrapper.py", line 287, in execute_goals
    goal(args, extra)
  File "/home/agrigorov/hydra/basics/.ci/ci-scripts/wrapper.py", line 31, in __call__
    self.function(args, extra)
  File "/home/agrigorov/hydra/basics/.ci/ci-scripts/wrapper.py", line 246, in do_sonar
    shell(f'mvn $MAVEN_ARGS -e -V -U sonar:sonar -Dsonar.branch.name="{args.branch}"', extra, args.repository)
  File "/home/agrigorov/hydra/basics/.ci/ci-scripts/wrapper.py", line 162, in shell
    result = subprocess.run(command, cwd = cwd, shell = True, check = check, stdout = stdout, stderr = stderr, encoding = sys.stdout.encoding)
  File "/usr/lib64/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'mvn $MAVEN_ARGS -e -V -U sonar:sonar -Dsonar.branch.name="#746"' returned non-zero exit status 1.
✘-1 ~/git/basics [master|✔] 

I'm unable to reopen this issue, so for now I will have to stick to repackaging this plugin without excess libraries.

@KTannenberg

This comment has been minimized.

Copy link
Contributor Author

commented Jul 18, 2019

Works fine after:

zip -d sevntu-checkstyle-sonar-plugin-1.34.1.jar \
          META-INF/lib/antlr4-runtime-4.7.2.jar \
          META-INF/lib/Saxon-HE-9.9.1-1.jar \
          META-INF/lib/antlr-2.7.7.jar \
          META-INF/lib/picocli-3.9.5.jar \
          META-INF/lib/checkstyle-8.18.jar \
          META-INF/lib/guava-15.0.jar

@romani romani reopened this Jul 18, 2019

@rnveach

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property 'tabWidth' does not exist, please check the documentation

This sounds like there is an issue with the configuration.
What are the versions of sevntu and checkstyle installed and what does the configuration look like?
We recently allowed tabWidth to be part of Checker. If checkstyle is an old version, it won't work with this new location for the property.

@rdiachenko

This comment has been minimized.

@rdiachenko

This comment has been minimized.

Copy link
Member

commented Jul 22, 2019

@KTannenberg , could you confirm please that 1.35.0 version works fine for you?

@romani

This comment has been minimized.

Copy link
Member

commented Jul 23, 2019

I closing issue, till new evidence of problems is provided

@romani romani closed this Jul 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.