Reg. Plugin class not found: 'com.mycompany.sonar.MyPlugin

217 views
Skip to first unread message

Rakini Murugesana

unread,
Jun 20, 2016, 6:03:55 PM6/20/16
to SonarQube
Hi Team,

       Greetings! I'm getting the above error when I run my project.I checked for the solutions for this error in that they have said to change to upper-case 'M' in com.mycompany.sonar.myPlugin to com.mycompany.sonar.MyPlugin. But mine is already in that format only. What else could be a problem? Before executing the project I just gave Maven-> Update Project for removing the errors.

When I run my project I get the following errors:

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 5.381 s

[INFO] Finished at: 2016-06-20T16:20:45-05:00

[INFO] Final Memory: 25M/251M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.sonarsource.sonar-packaging-maven-plugin:sonar-packaging-maven-plugin:1.15:sonar-plugin (default-sonar-plugin) on project java-custom-rules-template: Plugin class not found: 'com.mycompany.sonar.MyPlugin -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.sonar-packaging-maven-plugin:sonar-packaging-maven-plugin:1.15:sonar-plugin (default-sonar-plugin) on project java-custom-rules-template: Plugin class not found: 'com.mycompany.sonar.MyPlugin

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.apache.maven.cli.MavenCli.execute(MavenCli.java:863)

at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)

at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)

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: Plugin class not found: 'com.mycompany.sonar.MyPlugin

at org.sonarsource.pluginpackaging.SonarPluginMojo.checkPluginClass(SonarPluginMojo.java:115)

at org.sonarsource.pluginpackaging.SonarPluginMojo.execute(SonarPluginMojo.java:102)

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)

... 20 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


POM.xml:

       <plugin>

      <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>

      <artifactId>sonar-packaging-maven-plugin</artifactId>

      <version>1.15</version>

      <extensions>true</extensions>

      <configuration>

        <pluginClass>com.mycompany.sonar.MyPlugin</pluginClass>

      </configuration>

    </plugin>



Thanks for your valuable time. Eagerly waiting for the solution.Hope your team could guide me.

Simon Brandhof

unread,
Jun 21, 2016, 1:32:56 AM6/21/16
to Rakini Murugesana, SonarQube
Hi,

You should check that the class is correctly compiled and generated at target/classes/com/mycompany/sonar/MyPlugin.class. If the filename is still "myPlugin.class" without uppercase M, then clear the build workspace by executing "mvn clean install"

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/5b39516f-7490-40aa-bc37-a7b248fb4380%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Simon BRANDHOF | SonarSource
Tech Lead & Co-Founder
http://twitter.com/SimonBrandhof

Rakini Murugesana

unread,
Jun 21, 2016, 4:10:51 PM6/21/16
to SonarQube, rakinimu...@gmail.com
Hello Simon,

       Greetings! Thank you so much. Your information really helped me.
Reply all
Reply to author
Forward
0 new messages