I just switched to Maven 3.1 and saw that Findbugs was not reported on the page of the job anymore. When I switch back to Maven 3.0 it works like always.

      With Maven 3.1 I found two different warnings in the Logs:
      WARN org.apache.maven.eventspy.internal.EventSpyDispatcher - Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: Failed to load edu.umd.cs.findbugs.detect.TestASM

      WARN org.apache.maven.eventspy.internal.EventSpyDispatcher - Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: Could not initialize class edu.umd.cs.findbugs.SortedBugCollection

      Jenkins version: 1.526
      Jenkins Findbugs Plugin version: 4.49
      Findbugs Maven Plugin version: 2.5.2

        1. pluginversions.jpg
          pluginversions.jpg
          224 kB
        2. jenkins.log
          116 kB
        3. findbugs-maven-example.zip
          45 kB

          [JENKINS-19096] Findbugs Reporting not working with Maven 3.1

          Ulli Hafner added a comment -

          Is this a freestyle or maven job?

          Ulli Hafner added a comment - Is this a freestyle or maven job?

          It is a maven job.

          Sabine Achilles added a comment - It is a maven job.

          Ulli Hafner added a comment -

          Hmm, my build has no problem when running with maven 3.1.0. Is your build on the master or slave?

          Ulli Hafner added a comment - Hmm, my build has no problem when running with maven 3.1.0. Is your build on the master or slave?

          Both our Jenkins (on two seperate computers) run as the only master. And both have the same problem. We have the definition for FindBugs xml creation in the parent POM in the "profile" section.
          ...
          <profile>
          ...
          <build>
          <plugins>
          <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <configuration>
          <failOnError>false</failOnError>
          <xmlOutput>true</xmlOutput>
          </configuration>
          <executions>
          <execution>
          <goals>
          <goal>check</goal>
          </goals>
          </execution>
          </executions>
          </plugin>
          <plugins>
          <build>
          <profile>

          Sabine Achilles added a comment - Both our Jenkins (on two seperate computers) run as the only master. And both have the same problem. We have the definition for FindBugs xml creation in the parent POM in the "profile" section. ... <profile> ... <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <configuration> <failOnError>false</failOnError> <xmlOutput>true</xmlOutput> </configuration> <executions> <execution> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> <plugins> <build> <profile>

          Ulli Hafner added a comment -

          I still can't reproduce the problem. Can you please attach a small example project that exposes the bug?

          Ulli Hafner added a comment - I still can't reproduce the problem. Can you please attach a small example project that exposes the bug?

          I am experiencing the same problem, though this is the first Java/Maven project in our Jenkins setup.

          • Single master - no slaves
          • OpenJDK 7u25 + Maven 3.1.0 + Jenkins 1.527
          • FindBugs Maven 2.5.2 + FindBugs Jenkins 4.49
          • All other projects are PHP + Ant

          Log:

          INFO org.codehaus.mojo.findbugs.FindBugsMojo - Done FindBugs Analysis....
          WARN org.apache.maven.eventspy.internal.EventSpyDispatcher - Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: Failed to load edu.umd.cs.findbugs.detect.TestASM

          I do not see the message about SortedBugCollection in this bug's description.

          David Harkness added a comment - I am experiencing the same problem, though this is the first Java/Maven project in our Jenkins setup. Single master - no slaves OpenJDK 7u25 + Maven 3.1.0 + Jenkins 1.527 FindBugs Maven 2.5.2 + FindBugs Jenkins 4.49 All other projects are PHP + Ant Log: INFO org.codehaus.mojo.findbugs.FindBugsMojo - Done FindBugs Analysis.... WARN org.apache.maven.eventspy.internal.EventSpyDispatcher - Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: Failed to load edu.umd.cs.findbugs.detect.TestASM I do not see the message about SortedBugCollection in this bug's description.

          Here is an example which does not work on our Jenkins with Maven 3.1 but with Maven 3.0.

          Pre Step: "clean install" on the parent pom
          Build step: "clean install -P integration-build -X -e" on the parent pom

          Sabine Achilles added a comment - Here is an example which does not work on our Jenkins with Maven 3.1 but with Maven 3.0. Pre Step: "clean install" on the parent pom Build step: "clean install -P integration-build -X -e" on the parent pom

          Ulli Hafner added a comment -

          Ok, thanks. I installed the project, but it works on my machine.

          I'm using: Jenkins AND maven integration plugin 1.528. Can you retry with that version?

          BTW: i replaced the jgoodies version to 1.6.0 (the other is not in central)

          Ulli Hafner added a comment - Ok, thanks. I installed the project, but it works on my machine. I'm using: Jenkins AND maven integration plugin 1.528. Can you retry with that version? BTW: i replaced the jgoodies version to 1.6.0 (the other is not in central)

          I have tried it with Jenkins and MAven Plugin both at version 1.528 and it didn't change anything.
          Then I set up a new Jenkins on my local Win7 System (Tomcat6 with jenkins.war) with minimal Plugins installed. Also the same problem.
          I have attached the full log and a screenshot of the Plugin versions.

          Sabine Achilles added a comment - I have tried it with Jenkins and MAven Plugin both at version 1.528 and it didn't change anything. Then I set up a new Jenkins on my local Win7 System (Tomcat6 with jenkins.war) with minimal Plugins installed. Also the same problem. I have attached the full log and a screenshot of the Plugin versions.

          I forgot to mention that the total FindBugs count does show in the graph produced by the Violations plugin but not the graph created by the Static Analysis Collector plugin in the dashboard.

          David Harkness added a comment - I forgot to mention that the total FindBugs count does show in the graph produced by the Violations plugin but not the graph created by the Static Analysis Collector plugin in the dashboard.

          Ulli Hafner added a comment - - edited

          Ok, thanks. Seems that I misunderstand the problem in the first place. I thought there is an exception thrown by my plugin. However it is just not called!

          I can reproduce the bug now.

          Ulli Hafner added a comment - - edited Ok, thanks. Seems that I misunderstand the problem in the first place. I thought there is an exception thrown by my plugin. However it is just not called! I can reproduce the bug now.

          Ulli Hafner added a comment -

          Olivier, any ideas why the event spy can´t load all classes with maven 3.1?

          Ulli Hafner added a comment - Olivier, any ideas why the event spy can´t load all classes with maven 3.1?

          I also see this same problem running Jenkins 1.530 and Maven 3.1.0 with Oracle JDK 1.7.0_40 on CentOS 6.4 x86_64

          Eamonn Linehan added a comment - I also see this same problem running Jenkins 1.530 and Maven 3.1.0 with Oracle JDK 1.7.0_40 on CentOS 6.4 x86_64

          Mike Caspar added a comment -

          I have a similar problem.. Ubuntu 12.10 x64. Jenkins 1.532, JDK 1.7.0_40.

          I ended up removing the plugin from Jenkins and just letting the standard Maven plugin do the work.

          It got me the report I needed. I had to go to Workspace and scroll through to target, then find the reports but they are there... Eventually, we'll try the jenkins plugin again..

          Here is the url for the maven pom plugin settings... http://mojo.codehaus.org/findbugs-maven-plugin-2.4.0/usage.html

          Here are my settings from my POM. I needed to remove the jenkins plugin first... I'm not sure what having them both competing with each will do.

          The maven docs have the following...

          ......................

          <reporting>

          <plugins>

          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>${maven-project-info-reports-plugin.version}</version>
          </plugin>

          <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>2.5.1</version>
          </plugin>

          </plugins>

          </reporting>

          Mike Caspar added a comment - I have a similar problem.. Ubuntu 12.10 x64. Jenkins 1.532, JDK 1.7.0_40. I ended up removing the plugin from Jenkins and just letting the standard Maven plugin do the work. It got me the report I needed. I had to go to Workspace and scroll through to target, then find the reports but they are there... Eventually, we'll try the jenkins plugin again.. Here is the url for the maven pom plugin settings... http://mojo.codehaus.org/findbugs-maven-plugin-2.4.0/usage.html Here are my settings from my POM. I needed to remove the jenkins plugin first... I'm not sure what having them both competing with each will do. The maven docs have the following... ...................... <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>${maven-project-info-reports-plugin.version}</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>2.5.1</version> </plugin> </plugins> </reporting>

          Ulli Hafner added a comment -

          The easiest workaround is to use a freestyle job with a maven build step. Then you still have everything in Jenkins running.

          Ulli Hafner added a comment - The easiest workaround is to use a freestyle job with a maven build step. Then you still have everything in Jenkins running.

          Mike Caspar added a comment -

          Great idea Ulli. Thanks..I'll give that one a try as well.

          Mike Caspar added a comment - Great idea Ulli. Thanks..I'll give that one a try as well.

          clausfod added a comment -

          We have the same problem on 1.533 running Windows 2008. JDK 1.7.0_40 - We are using Maven 3.1.0 and findbugs plugin 4.51. The problem also exist when runnning maven 3.0.X

          clausfod added a comment - We have the same problem on 1.533 running Windows 2008. JDK 1.7.0_40 - We are using Maven 3.1.0 and findbugs plugin 4.51. The problem also exist when runnning maven 3.0.X

          Ulli Hafner added a comment -

          @clausfod: The findbugs plug-in should work in a maven job with maven 3.0.x out of the box. What problems are occurring there? Please file a new bug report with more details if something is broken there, this issue is related to maven 3.1.x only.

          Ulli Hafner added a comment - @clausfod: The findbugs plug-in should work in a maven job with maven 3.0.x out of the box. What problems are occurring there? Please file a new bug report with more details if something is broken there, this issue is related to maven 3.1.x only.

          Hi,

          Just noticed some of our Maven 3.1 builds are not reporting findbugs errors due to this issue.
          I will set them to Maven 3.0.x for now.

          Any ideas on how to fix this?

          thanks
          Geoff

          Geoff Cummings added a comment - Hi, Just noticed some of our Maven 3.1 builds are not reporting findbugs errors due to this issue. I will set them to Maven 3.0.x for now. Any ideas on how to fix this? thanks Geoff

          Mark Waite added a comment -

          Ulli suggested using a freestyle job with a maven job step instead of the maven job. Does that not work for you?

          Mark Waite added a comment - Ulli suggested using a freestyle job with a maven job step instead of the maven job. Does that not work for you?

          Ulli Hafner added a comment -

          I'm wondering if it still makes sense to continue development of the maven job type in my plugins. There are so many class loading issues that should be resolved automatically if the freestyle builder would be used instead... Maybe I should use the same approach as in the warnings plug-in, one publisher for both the maven and the freestyle job.

          Ulli Hafner added a comment - I'm wondering if it still makes sense to continue development of the maven job type in my plugins. There are so many class loading issues that should be resolved automatically if the freestyle builder would be used instead... Maybe I should use the same approach as in the warnings plug-in, one publisher for both the maven and the freestyle job.

          Mark Waite added a comment -

          I fear that the outcry will be very loud if you stop supporting the maven job type in your plugins. I wish it were different, but I'm sure there are many Jenkins users who use the maven job type and are critically dependent on your plugins. If you stop supporting the maven job type, they'll be very frustrated.

          Mark Waite added a comment - I fear that the outcry will be very loud if you stop supporting the maven job type in your plugins. I wish it were different, but I'm sure there are many Jenkins users who use the maven job type and are critically dependent on your plugins. If you stop supporting the maven job type, they'll be very frustrated.

          Ulli Hafner added a comment -

          Sorry, this was not precise and needs some clarification: if I remove the special maven handling then the plug-in will still be usable in maven and freestyle jobs. Currently the findbugs plugin uses two different implementations: one gets instantiated by freestyle jobs and the other by maven jobs. In the warnings plugin I'm having only one implementation that is instantiated for both build types. This makes coding and testing much easier (DRY) and has no classloading problems. The only benefit for having a special maven implementation is to derive the filename of the findbugs warnings from the pom.

          Ulli Hafner added a comment - Sorry, this was not precise and needs some clarification: if I remove the special maven handling then the plug-in will still be usable in maven and freestyle jobs. Currently the findbugs plugin uses two different implementations: one gets instantiated by freestyle jobs and the other by maven jobs. In the warnings plugin I'm having only one implementation that is instantiated for both build types. This makes coding and testing much easier (DRY) and has no classloading problems. The only benefit for having a special maven implementation is to derive the filename of the findbugs warnings from the pom.

          Mark Waite added a comment -

          I see. Removing the special case handling for maven type jobs seems very reasonable to me. I don't know how you would perform the migration in the plugin, but I assume even that is possible, since the pom must contain the information you need.

          Mark Waite added a comment - I see. Removing the special case handling for maven type jobs seems very reasonable to me. I don't know how you would perform the migration in the plugin, but I assume even that is possible, since the pom must contain the information you need.

          Vadim Dedkov added a comment - - edited

          My parameters:
          Jenkins version: 1.544
          Jenkins Findbugs Plugin version: 4.56
          Findbugs Maven Plugin version: 2.5.2

          When I put in goals and options in settings of my job "clean org.codehaus.mojo:findbugs-maven-plugin:2.5.2:findbugs deploy -U"
          I didn'n find findbugs icon and findbugs*.xml-files in build directory,
          but when I put "clean install org.codehaus.mojo:findbugs-maven-plugin:2.5.2:findbugs deploy -U"
          I found findbugs icon and findbugs*.xml-files in build directory of my project.

          That is, when I put "install" then findbugs started working.

          Vadim Dedkov added a comment - - edited My parameters: Jenkins version: 1.544 Jenkins Findbugs Plugin version: 4.56 Findbugs Maven Plugin version: 2.5.2 When I put in goals and options in settings of my job "clean org.codehaus.mojo:findbugs-maven-plugin:2.5.2:findbugs deploy -U" I didn'n find findbugs icon and findbugs*.xml-files in build directory, but when I put "clean install org.codehaus.mojo:findbugs-maven-plugin:2.5.2:findbugs deploy -U" I found findbugs icon and findbugs*.xml-files in build directory of my project. That is, when I put "install" then findbugs started working.

          Daan Hoogland added a comment -

          H all, I started noticing this on jenkins.buildacloud.org (the apache cloudstack ci). I reproduced the job we have there internally at Schuberg Philis. There it does produce reports on the enterprise jenkins. I am triaging the differences but not hopefull as most of the obvious have passed. Any progress on this issue yet? Let me know if I can help with further info.

          Daan, also reachable as dhoogland at our company name without the space dot com

          Daan Hoogland added a comment - H all, I started noticing this on jenkins.buildacloud.org (the apache cloudstack ci). I reproduced the job we have there internally at Schuberg Philis. There it does produce reports on the enterprise jenkins. I am triaging the differences but not hopefull as most of the obvious have passed. Any progress on this issue yet? Let me know if I can help with further info. Daan, also reachable as dhoogland at our company name without the space dot com

          Ulli Hafner added a comment -

          @Daan: Currently there are no plans to fix the class loading issues of the maven plug-in. Please use a freestyle project until I find some time to migrate my plug-in actions so they do not require the maven plug-in anymore.

          Ulli Hafner added a comment - @Daan: Currently there are no plans to fix the class loading issues of the maven plug-in. Please use a freestyle project until I find some time to migrate my plug-in actions so they do not require the maven plug-in anymore.

          podskalsky added a comment -

          I can't accept "switch to the freestyle project" !

          A freestyle project has not the requered extended Maven features which are used by our projects.

          For example:

          POM_* variables from pom.xml are missing in env
          MAVEN_HOME variable is missing in env
          Artifactory-Plugin is not able to find artifacts in freestyle project
          artifacts have different names like at maven project (at finalName was ignored at freestyle project - name was artifacId)
          collecting reports (checkstyle, pmd, findbugs, junit, jacoco, ...) is not easy
          ...

          podskalsky added a comment - I can't accept "switch to the freestyle project" ! A freestyle project has not the requered extended Maven features which are used by our projects. For example: POM_* variables from pom.xml are missing in env MAVEN_HOME variable is missing in env Artifactory-Plugin is not able to find artifacts in freestyle project artifacts have different names like at maven project (at finalName was ignored at freestyle project - name was artifacId) collecting reports (checkstyle, pmd, findbugs, junit, jacoco, ...) is not easy ...

          Mark Waite added a comment -

          podskalsky, since this is an open source project, you're welcome to submit pull requests. There is a wiki page that will help you get started as a Jenkins developer. Don't forget to include tests of your changes (as recommended in that wiki page).

          Mark Waite added a comment - podskalsky , since this is an open source project, you're welcome to submit pull requests. There is a wiki page that will help you get started as a Jenkins developer. Don't forget to include tests of your changes (as recommended in that wiki page).

          Ulli Hafner added a comment -

          This issue is also fixed by pull request for JENKINS-26923.

          Ulli Hafner added a comment - This issue is also fixed by pull request for JENKINS-26923 .

            drulli Ulli Hafner
            achbine Sabine Achilles
            Votes:
            17 Vote for this issue
            Watchers:
            30 Start watching this issue

              Created:
              Updated:
              Resolved: