Maven 1.x JCoverage Plugin
  1. Maven 1.x JCoverage Plugin
  2. MPJCOVERAGE-15

FileNotFoundException after project clean goal run.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Maven 1.0, Java 1.4.2_05, Windows XP
    • Number of attachments :
      3

      Description

      I get a FileNotFoundException running the jcoverage goal after a clean goal has been run. See attached stacktrace.

        Activity

        Hide
        Ricardo Gladwell added a comment -

        Stack trace of FileNotFoundException.

        Show
        Ricardo Gladwell added a comment - Stack trace of FileNotFoundException.
        Hide
        Ricardo Gladwell added a comment -

        This is caused by an out-of-date jcoverage.ser file. Since this file is not stored in the target directory when it is generated, but in the root of the project it is not deleted during a 'clean' goal and therefore attempts to generate output for deleted files, etc.

        Show
        Ricardo Gladwell added a comment - This is caused by an out-of-date jcoverage.ser file. Since this file is not stored in the target directory when it is generated, but in the root of the project it is not deleted during a 'clean' goal and therefore attempts to generate output for deleted files, etc.
        Hide
        Steve Gudmundson added a comment -

        I am also getting this error. I have found that if I create the full directory path that the FileNotFoundException references then run the goal again, it will work. So the problem seems to be that it is trying to write the file to a directory that has not yet been created. Is anyone working on this? If not maybe I will pop the code open and have a look.

        Show
        Steve Gudmundson added a comment - I am also getting this error. I have found that if I create the full directory path that the FileNotFoundException references then run the goal again, it will work. So the problem seems to be that it is trying to write the file to a directory that has not yet been created. Is anyone working on this? If not maybe I will pop the code open and have a look.
        Hide
        Steve Gudmundson added a comment -

        Here is the fix compared to MAVEN_JCOVERAGE_1_0_9 version of the CoverageReport.java file:

        159a160,164
        > // BEGIN MPJCOVERAGE-15 FIX //
        > String pkgdirname = pkg.getDirectory() + "/";
        > File pkgFileDir = new File(dir, pkgdirname);
        > pkgFileDir.mkdirs();
        > // END MPJCOVERAGE-15 FIX //

        http://svn.apache.org/repos/asf/maven/maven-1/plugins/tags/MAVEN_JCOVERAGE_1_0_9/jcoverage/src/main/org/apache/maven/jcoveragereport/CoverageReport.java

        Attached is the .class file with this change and a new maven-jcoverage-plugin.jar containing this change.

        Show
        Steve Gudmundson added a comment - Here is the fix compared to MAVEN_JCOVERAGE_1_0_9 version of the CoverageReport.java file: 159a160,164 > // BEGIN MPJCOVERAGE-15 FIX // > String pkgdirname = pkg.getDirectory() + "/"; > File pkgFileDir = new File(dir, pkgdirname); > pkgFileDir.mkdirs(); > // END MPJCOVERAGE-15 FIX // http://svn.apache.org/repos/asf/maven/maven-1/plugins/tags/MAVEN_JCOVERAGE_1_0_9/jcoverage/src/main/org/apache/maven/jcoveragereport/CoverageReport.java Attached is the .class file with this change and a new maven-jcoverage-plugin.jar containing this change.
        Hide
        Michael Osipov added a comment -

        Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

        Show
        Michael Osipov added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ricardo Gladwell
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: