Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-2287

findbug plugin fails to point to sourcecode

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • findbugs-plugin
    • None
    • Platform: All, OS: All

    Description

      When I try to dig into the findbug errors and warnings, I end up with an error,
      because findbugs builds the path to the source file incorrectly. This is a maven
      2 project, not a freestyle project. Error is:

      Can't read file:
      /root/.hudson/jobs/oev-energieausweis/workspace/workspace/oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/job/PersoenlicheDatenLoeschenJob.java
      (No such file or directory)

      Note the double 'workspace' part in the path. Correct path would be:

      /root/.hudson/jobs/oev-energieausweis/workspace/oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/job/PersoenlicheDatenLoeschenJob.java

      The project directory structure is:

      aek@ci:/root/.hudson/jobs/oev-energieausweis/workspace$ find . -type d | grep -v
      -e 'target' -e 'builds' -e '.svn'
      .
      ./oev-energieausweis-pdfgenerator
      ./oev-energieausweis-pdfgenerator/templates
      ./oev-energieausweis-pdfgenerator/templates/unterschriften
      ./oev-energieausweis-pdfgenerator/src
      ./oev-energieausweis-pdfgenerator/src/test
      ./oev-energieausweis-pdfgenerator/src/test/java
      ./oev-energieausweis-pdfgenerator/src/test/java/de
      ./oev-energieausweis-pdfgenerator/src/test/java/de/codecentric
      ./oev-energieausweis-pdfgenerator/src/test/java/de/codecentric/oev
      ./oev-energieausweis-pdfgenerator/src/test/java/de/codecentric/oev/energieausweis
      ./oev-energieausweis-pdfgenerator/src/test/java/de/codecentric/oev/energieausweis/pdf
      ./oev-energieausweis-pdfgenerator/src/main
      ./oev-energieausweis-pdfgenerator/src/main/java
      ./oev-energieausweis-pdfgenerator/src/main/java/de
      ./oev-energieausweis-pdfgenerator/src/main/java/de/codecentric
      ./oev-energieausweis-pdfgenerator/src/main/java/de/codecentric/oev
      ./oev-energieausweis-pdfgenerator/src/main/java/de/codecentric/oev/energieausweis
      ./oev-energieausweis-pdfgenerator/src/main/java/de/codecentric/oev/energieausweis/pdf
      ./oev-energieausweis-pdfgenerator/src/main/java/de/codecentric/oev/energieausweis/pdf/service
      ./oev-energieausweis-pdfgenerator/src/main/java/de/codecentric/oev/energieausweis/pdf/service/impl
      ./oev-energieausweis-pdfgenerator/src/main/java/de/codecentric/oev/energieausweis/pdf/generator
      ./oev-energieausweis-pdfgenerator/src/main/java/de/codecentric/oev/energieausweis/pdf/generator/impl
      ./oev-energieausweis-pdfgenerator/src/main/java/de/codecentric/oev/energieausweis/pdf/util
      ./oev-energieausweis-pdfgenerator/src/main/java/META-INF
      ./oev-energieausweis-pdfgenerator/jar
      ./oev-energieausweis-pdfgenerator/lib
      ./oev-energieausweis-pdfgenerator/lib/dev
      ./oev-energieausweis-verwaltung
      ./oev-energieausweis-verwaltung/src
      ./oev-energieausweis-verwaltung/src/test
      ./oev-energieausweis-verwaltung/src/test/java
      ./oev-energieausweis-verwaltung/src/test/java/de
      ./oev-energieausweis-verwaltung/src/test/java/de/codecentric
      ./oev-energieausweis-verwaltung/src/test/java/de/codecentric/oev
      ./oev-energieausweis-verwaltung/src/test/java/de/codecentric/oev/abschlussmodul
      ./oev-energieausweis-verwaltung/src/test/java/de/codecentric/oev/abschlussmodul/verwaltung
      ./oev-energieausweis-verwaltung/src/test/java/de/codecentric/oev/abschlussmodul/verwaltung/benutzer
      ./oev-energieausweis-verwaltung/src/test/java/de/codecentric/oev/abschlussmodul/workflow
      ./oev-energieausweis-verwaltung/src/test/resources
      ./oev-energieausweis-verwaltung/src/test/resources/daten
      ./oev-energieausweis-verwaltung/src/test/resources/daten/oev
      ./oev-energieausweis-verwaltung/src/test/resources/xml
      ./oev-energieausweis-verwaltung/src/test/resources/xml/spring
      ./oev-energieausweis-verwaltung/src/main
      ./oev-energieausweis-verwaltung/src/main/webapp
      ./oev-energieausweis-verwaltung/src/main/webapp/img
      ./oev-energieausweis-verwaltung/src/main/webapp/js
      ./oev-energieausweis-verwaltung/src/main/webapp/style
      ./oev-energieausweis-verwaltung/src/main/webapp/style/pics
      ./oev-energieausweis-verwaltung/src/main/webapp/style/pics/mfl
      ./oev-energieausweis-verwaltung/src/main/webapp/style/pics/browserhinweis
      ./oev-energieausweis-verwaltung/src/main/webapp/WEB-INF
      ./oev-energieausweis-verwaltung/src/main/webapp/WEB-INF/classes
      ./oev-energieausweis-verwaltung/src/main/webapp/WEB-INF/jsp
      ./oev-energieausweis-verwaltung/src/main/webapp/WEB-INF/jsp/includes
      ./oev-energieausweis-verwaltung/src/main/webapp/WEB-INF/lib
      ./oev-energieausweis-verwaltung/src/main/webapp/META-INF
      ./oev-energieausweis-verwaltung/src/main/java
      ./oev-energieausweis-verwaltung/src/main/java/de
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/verwaltung
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/verwaltung/aktionen
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/verwaltung/interceptoren
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/verwaltung/sitzung
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/verwaltung/sitzung/standard
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/verwaltung/benutzer
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/verwaltung/benutzer/standard
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/verwaltung/view
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/verwaltung/tags
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/verwaltung/util
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/job
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/workflow
      ./oev-energieausweis-verwaltung/src/main/java/de/codecentric/oev/energieausweis/workflow/utils
      ./oev-energieausweis-verwaltung/src/main/resources
      ./oev-energieausweis-verwaltung/src/main/resources/daten
      ./oev-energieausweis-verwaltung/src/main/resources/daten/oev
      ./oev-energieausweis-verwaltung/src/main/resources/daten/oev/mandant
      ./oev-energieausweis-verwaltung/src/main/resources/daten/oev/persistenz
      ./oev-energieausweis-verwaltung/bin
      ./oev-energieausweis-verwaltung/dev
      ./oev-energieausweis-verwaltung/dev/job
      ./oev-energieausweis-verwaltung/dev/jndi
      ./oev-energieausweis-verwaltung/bintest
      ./oev-energieausweis-verwaltung/lib
      ./oev-energieausweis-persistenz
      ./oev-energieausweis-persistenz/src
      ./oev-energieausweis-persistenz/src/test
      ./oev-energieausweis-persistenz/src/test/java
      ./oev-energieausweis-persistenz/src/test/java/de
      ./oev-energieausweis-persistenz/src/test/java/de/codecentric
      ./oev-energieausweis-persistenz/src/test/java/de/codecentric/oev
      ./oev-energieausweis-persistenz/src/test/java/de/codecentric/oev/energieausweis
      ./oev-energieausweis-persistenz/src/test/java/de/codecentric/oev/energieausweis/persistenz
      ./oev-energieausweis-persistenz/src/test/java/de/codecentric/oev/energieausweis/persistenz/service
      ./oev-energieausweis-persistenz/src/test/java/de/codecentric/oev/energieausweis/persistenz/hibernate
      ./oev-energieausweis-persistenz/src/test/resources
      ./oev-energieausweis-persistenz/src/test/resources/daten
      ./oev-energieausweis-persistenz/src/test/resources/daten/oev
      ./oev-energieausweis-persistenz/src/main
      ./oev-energieausweis-persistenz/src/main/java
      ./oev-energieausweis-persistenz/src/main/java/de
      ./oev-energieausweis-persistenz/src/main/java/de/codecentric
      ./oev-energieausweis-persistenz/src/main/java/de/codecentric/oev
      ./oev-energieausweis-persistenz/src/main/java/de/codecentric/oev/energieausweis
      ./oev-energieausweis-persistenz/src/main/java/de/codecentric/oev/energieausweis/persistenz
      ./oev-energieausweis-persistenz/src/main/java/de/codecentric/oev/energieausweis/persistenz/service
      ./oev-energieausweis-persistenz/src/main/java/de/codecentric/oev/energieausweis/persistenz/service/standard
      ./oev-energieausweis-persistenz/src/main/java/de/codecentric/oev/energieausweis/persistenz/hibernate
      ./oev-energieausweis-persistenz/src/main/java/de/codecentric/oev/energieausweis/persistenz/modell
      ./oev-energieausweis-persistenz/src/main/java/META-INF
      ./oev-energieausweis-persistenz/src/main/resources
      ./oev-energieausweis-persistenz/src/main/resources/daten
      ./oev-energieausweis-persistenz/src/main/resources/daten/oev
      ./oev-energieausweis-persistenz/src/main/resources/de
      ./oev-energieausweis-persistenz/src/main/resources/de/codecentric
      ./oev-energieausweis-persistenz/src/main/resources/de/codecentric/oev
      ./oev-energieausweis-persistenz/src/main/resources/de/codecentric/oev/energieausweis
      ./oev-energieausweis-persistenz/src/main/resources/de/codecentric/oev/energieausweis/persistenz
      ./oev-energieausweis-persistenz/src/main/resources/de/codecentric/oev/energieausweis/persistenz/modell
      ./oev-energieausweis-persistenz/dev
      ./oev-energieausweis-persistenz/dev/mysql
      ./oev-energieausweis-persistenz/dev/mysql/lokal
      ./oev-energieausweis-persistenz/dev/mysql/dev
      ./oev-energieausweis-persistenz/dev/hibernate
      ./oev-energieausweis-persistenz/dev/hibernate/reveng
      ./oev-energieausweis-persistenz/dev/hibernate/lib
      ./oev-energieausweis-persistenz/jar
      ./oev-energieausweis-persistenz/lib
      ./oev-energieausweis-persistenz/lib/dev
      ./oev-energieausweis-parent

      Attachments

        Issue Links

          Activity

            drulli Ulli Hafner added a comment -

            Issue 2052 seems to be related.

            drulli Ulli Hafner added a comment - Issue 2052 seems to be related.
            drulli Ulli Hafner added a comment -

            Hope, the fix for Issue 2052 will solve this problem too.

            drulli Ulli Hafner added a comment - Hope, the fix for Issue 2052 will solve this problem too.
            aebbert aebbert added a comment -

            I wanted to test the fix, but I couldn't:

            1) Hudson notified me of a new plugin version (2.15), which I downloaded and
            installed
            2) I restarted glassfish, on which hudson is deployed
            3) error is still there, BUT
            4) installed plugin-version is still 2.14 (at least to hudson ui), but it not in
            the list of plugins to update any longer.

            Was there an error in the update process, or does the plugin contain the wrong
            meta-data?

            Andreas

            aebbert aebbert added a comment - I wanted to test the fix, but I couldn't: 1) Hudson notified me of a new plugin version (2.15), which I downloaded and installed 2) I restarted glassfish, on which hudson is deployed 3) error is still there, BUT 4) installed plugin-version is still 2.14 (at least to hudson ui), but it not in the list of plugins to update any longer. Was there an error in the update process, or does the plugin contain the wrong meta-data? Andreas
            drulli Ulli Hafner added a comment -

            See
            https://hudson.dev.java.net/servlets/ProjectDocumentList?folderID=7826&expandFolder=7826&folderID=5818.

            2.15 Stable drulli on Sunday, August 31, 2008 at 1:56:00 PM

            The patch is in 2.15 so 2.14 will still not work. The update center seems not to
            be up-to-date, I think you need to wait another day (or upgrade manually).

            drulli Ulli Hafner added a comment - See https://hudson.dev.java.net/servlets/ProjectDocumentList?folderID=7826&expandFolder=7826&folderID=5818 . 2.15 Stable drulli on Sunday, August 31, 2008 at 1:56:00 PM The patch is in 2.15 so 2.14 will still not work. The update center seems not to be up-to-date, I think you need to wait another day (or upgrade manually).
            aebbert aebbert added a comment -

            Upgraded to version 2.15 but now I cannot even klick on the source file names in
            the report, that earlier lead to the error message (and should lead to the
            annotated source file view).

            So unless I can test the fixed behaviour, this issue goes back to open.

            aebbert aebbert added a comment - Upgraded to version 2.15 but now I cannot even klick on the source file names in the report, that earlier lead to the error message (and should lead to the annotated source file view). So unless I can test the fixed behaviour, this issue goes back to open.
            drulli Ulli Hafner added a comment -

            Seems that the whole source code finder is broken now Even for freestyle
            project I get no source references.

            drulli Ulli Hafner added a comment - Seems that the whole source code finder is broken now Even for freestyle project I get no source references.
            drulli Ulli Hafner added a comment -

            A new release is out that will at least show the sources again for freestyle
            projects. I'm not sure if it changes something for your issue.

            I'll have a closer look next week on the m2 project problems.

            drulli Ulli Hafner added a comment - A new release is out that will at least show the sources again for freestyle projects. I'm not sure if it changes something for your issue. I'll have a closer look next week on the m2 project problems.
            ritzmann ritzmann added a comment -

            adding myself to cc

            ritzmann ritzmann added a comment - adding myself to cc
            depsypher depsypher added a comment -

            I've noticed that links to source code are missing in hudson when the project
            has more than one sourcepath.

            i.e. I have two projects; one that builds a jar from a single source tree, and
            another that builds an ear from several source locations... the findbugs
            warnings in the jar project have links to source in hudson, and the ear project
            doesn't.

            Hope that helps narrow this problem down.

            depsypher depsypher added a comment - I've noticed that links to source code are missing in hudson when the project has more than one sourcepath. i.e. I have two projects; one that builds a jar from a single source tree, and another that builds an ear from several source locations... the findbugs warnings in the jar project have links to source in hudson, and the ear project doesn't. Hope that helps narrow this problem down.
            drulli Ulli Hafner added a comment -

            Hi depsypher,

            are you using the m2 mode? I though maven can't handle multiple source paths?

            Ulli

            drulli Ulli Hafner added a comment - Hi depsypher, are you using the m2 mode? I though maven can't handle multiple source paths? Ulli
            drulli Ulli Hafner added a comment -

            Hi all,

            I can't reproduce this bug. Can someone attach a small testcase so I can
            reproduce the bug on my machine? I think the stripped pom files and a source
            with a warning should help to locate the problem. Or write by mail if you won't
            like to get your sources published in this issue.

            Thanks, Ulli

            drulli Ulli Hafner added a comment - Hi all, I can't reproduce this bug. Can someone attach a small testcase so I can reproduce the bug on my machine? I think the stripped pom files and a source with a warning should help to locate the problem. Or write by mail if you won't like to get your sources published in this issue. Thanks, Ulli
            depsypher depsypher added a comment -

            No, I'm using a regular ant build, sorry for the confusion. I can open a
            separate bug if it makes the problem easier to track.

            depsypher depsypher added a comment - No, I'm using a regular ant build, sorry for the confusion. I can open a separate bug if it makes the problem easier to track.
            drulli Ulli Hafner added a comment -

            Ok, then it might be good to have a separate issue.

            Before creating the issue, please check if you did specify all of your source
            paths in your ant build.xml file:

            <sourcePath path="src/java:src/java5:src/junit"/>

            If you did, then please attach the created findbugs.xml file of your build to
            the issue. Then I can use this file to track down the error.

            Thanks, Ulli

            drulli Ulli Hafner added a comment - Ok, then it might be good to have a separate issue. Before creating the issue, please check if you did specify all of your source paths in your ant build.xml file: <sourcePath path="src/java:src/java5:src/junit"/> If you did, then please attach the created findbugs.xml file of your build to the issue. Then I can use this file to track down the error. Thanks, Ulli

            Same bug here:
            [...]
            [FINDBUGS] Successfully parsed file
            /home/tomcat/.hudson/jobs/Onyx/workspace/trunk/onyx-util/target/findbugs.xml of
            module Onyx Util with 4 warnings.
            [FINDBUGS] Can't copy file from slave to master:
            slave=workspace/trunk/onyx-util/src/main/java/org/obiba/onyx/util/data/Data.java, master=6f103037.tmp
            java.io.FileNotFoundException:
            workspace/trunk/onyx-util/src/main/java/org/obiba/onyx/util/data/Data.java (No
            such file or directory)
            [...]

            The project is a m2 project with a top-level pom (trunk/pom.xml) and several
            sub-modules one of which is onyx-util (trunk/onyx-util/pom.xml).

            I can see the FindBugs reports in Hudson, but all the links in the report are
            borken (404). The "Module" tab, the "Package" tab, the "File" tab etc.

            A few notes:

            • PMD warnings report is working properly even the links to the Java file and
              code highlighting.
            • I'm using findbugs-maven-plugin version 2.0-SNAPSHOT in order to get FindBugs
              1.3.6.
            plaflamme Philippe Laflamme added a comment - Same bug here: [...] [FINDBUGS] Successfully parsed file /home/tomcat/.hudson/jobs/Onyx/workspace/trunk/onyx-util/target/findbugs.xml of module Onyx Util with 4 warnings. [FINDBUGS] Can't copy file from slave to master: slave=workspace/trunk/onyx-util/src/main/java/org/obiba/onyx/util/data/Data.java, master=6f103037.tmp java.io.FileNotFoundException: workspace/trunk/onyx-util/src/main/java/org/obiba/onyx/util/data/Data.java (No such file or directory) [...] The project is a m2 project with a top-level pom (trunk/pom.xml) and several sub-modules one of which is onyx-util (trunk/onyx-util/pom.xml). I can see the FindBugs reports in Hudson, but all the links in the report are borken (404). The "Module" tab, the "Package" tab, the "File" tab etc. A few notes: PMD warnings report is working properly even the links to the Java file and code highlighting. I'm using findbugs-maven-plugin version 2.0-SNAPSHOT in order to get FindBugs 1.3.6.
            drulli Ulli Hafner added a comment -

            Can you please attach your findbugsXml.xml file?

            If possible, a small testcase/testproject would help me to locate this bug, I
            still can't reproduce it here on my machine

            drulli Ulli Hafner added a comment - Can you please attach your findbugsXml.xml file? If possible, a small testcase/testproject would help me to locate this bug, I still can't reproduce it here on my machine
            drulli Ulli Hafner added a comment -

            Should be fixed with #2714.

            drulli Ulli Hafner added a comment - Should be fixed with #2714.

            People

              drulli Ulli Hafner
              aebbert aebbert
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: