• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • jacoco-plugin
    • None

      The plugin can fail with a maven multi-module project, that has duplicate source files in different modules.

      For example, if two projects define com/somepackage/package-info.java, the first one is copied to the target jacoco/sources directory, its permissions are set to read only, and so the second one fails ...

      hudson.util.IOException2: Failed to extract /home/jenkins/workspace/Maven Build/Diffusion/Main/modules/module1/src/main/java/**/*
      	at hudson.FilePath.readFromTar(FilePath.java:2041)
      	at hudson.FilePath.copyRecursiveTo(FilePath.java:1953)
      	at hudson.FilePath.copyRecursiveTo(FilePath.java:1858)
      	at hudson.FilePath.copyRecursiveTo(FilePath.java:1843)
      	at hudson.plugins.jacoco.JacocoReportDir.saveSourcesFrom(JacocoReportDir.java:46)
      	at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:350)
      	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
      	at hudson.model.Build$BuildExecution.post2(Build.java:183)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
      	at hudson.model.Run.execute(Run.java:1622)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:247)
      Caused by: java.io.FileNotFoundException: /home/tester/.jenkins/jobs/Maven Build/builds/2013-09-16_10-22-57/jacoco/sources/com/somepackage/package-info.java (Permission denied)
      	at java.io.FileOutputStream.open(Native Method)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
      	at hudson.util.IOUtils.copy(IOUtils.java:35)
      	at hudson.FilePath.readFromTar(FilePath.java:2031)
      

      A general solution to this problem is for the plugin to associate each exec file with a separate source directory.

          [JENKINS-19594] Separate source directories

          shweta G added a comment -

          Hi,

          Even I am getting the same kind of error, can someone please help me with this.

          D:\Jenkins\for-dev\workspace\dev_Q_Build\ESO\dev\src\mobile_es\MyNotes\extjsERROR: Publisher hudson.plugins.jacoco.JacocoPublisher aborted due to exception
          10:23:13 java.io.IOException: Failed to extract D:\Jenkins\for-dev\workspace\dev_Q_Build\ESO\dev\src\mobile_es\MyNotes\metadata/*/
          10:23:13 at hudson.FilePath.readFromTar(FilePath.java:2198)
          10:23:13 at hudson.FilePath.copyRecursiveTo(FilePath.java:2109)
          10:23:13 at hudson.FilePath.copyRecursiveTo(FilePath.java:2013)
          10:23:13 at hudson.FilePath.copyRecursiveTo(FilePath.java:1996)
          10:23:13 at hudson.FilePath.copyRecursiveTo(FilePath.java:1981)
          10:23:13 at hudson.plugins.jacoco.JacocoReportDir.saveSourcesFrom(JacocoReportDir.java:46)
          10:23:13 at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:353)
          10:23:13 at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
          10:23:13 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
          10:23:13 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
          10:23:13 at hudson.model.Build$BuildExecution.post2(Build.java:183)
          10:23:13 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
          10:23:13 at hudson.model.Run.execute(Run.java:1770)
          10:23:13 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          10:23:13 at hudson.model.ResourceController.execute(ResourceController.java:89)
          10:23:13 at hudson.model.Executor.run(Executor.java:240)
          10:23:13 Caused by: java.io.FileNotFoundException: D:\Jenkins\jobs\dev_Q_Build\builds\2015-10-07_09-07-36\jacoco\sources\Application (Access is denied)
          10:23:13 at java.io.FileOutputStream.open(Native Method)
          10:23:13 at java.io.FileOutputStream.<init>(Unknown Source)
          10:23:13 at java.io.FileOutputStream.<init>(Unknown Source)
          10:23:13 at hudson.util.IOUtils.copy(IOUtils.java:38)
          10:23:13 at hudson.FilePath.readFromTar(FilePath.java:2188)
          10:23:13 ... 15 more

          Thanks
          Shweta

          shweta G added a comment - Hi, Even I am getting the same kind of error, can someone please help me with this. D:\Jenkins\for-dev\workspace\dev_Q_Build\ESO\dev\src\mobile_es\MyNotes\extjsERROR: Publisher hudson.plugins.jacoco.JacocoPublisher aborted due to exception 10:23:13 java.io.IOException: Failed to extract D:\Jenkins\for-dev\workspace\dev_Q_Build\ESO\dev\src\mobile_es\MyNotes\metadata/* / 10:23:13 at hudson.FilePath.readFromTar(FilePath.java:2198) 10:23:13 at hudson.FilePath.copyRecursiveTo(FilePath.java:2109) 10:23:13 at hudson.FilePath.copyRecursiveTo(FilePath.java:2013) 10:23:13 at hudson.FilePath.copyRecursiveTo(FilePath.java:1996) 10:23:13 at hudson.FilePath.copyRecursiveTo(FilePath.java:1981) 10:23:13 at hudson.plugins.jacoco.JacocoReportDir.saveSourcesFrom(JacocoReportDir.java:46) 10:23:13 at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:353) 10:23:13 at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) 10:23:13 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) 10:23:13 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) 10:23:13 at hudson.model.Build$BuildExecution.post2(Build.java:183) 10:23:13 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683) 10:23:13 at hudson.model.Run.execute(Run.java:1770) 10:23:13 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 10:23:13 at hudson.model.ResourceController.execute(ResourceController.java:89) 10:23:13 at hudson.model.Executor.run(Executor.java:240) 10:23:13 Caused by: java.io.FileNotFoundException: D:\Jenkins\jobs\dev_Q_Build\builds\2015-10-07_09-07-36\jacoco\sources\Application (Access is denied) 10:23:13 at java.io.FileOutputStream.open(Native Method) 10:23:13 at java.io.FileOutputStream.<init>(Unknown Source) 10:23:13 at java.io.FileOutputStream.<init>(Unknown Source) 10:23:13 at hudson.util.IOUtils.copy(IOUtils.java:38) 10:23:13 at hudson.FilePath.readFromTar(FilePath.java:2188) 10:23:13 ... 15 more Thanks Shweta

          Philip Aston added a comment -

          I'm the original reporter, not the maintainer.

          Philip Aston added a comment - I'm the original reporter, not the maintainer.

          shweta G added a comment -

          ok.
          details of jacoco which i have used in my project.

          jacoco version : jacoco-0.6.2.201302030002
          plugin version : 1.0.19

          thanks
          Shweta

          shweta G added a comment - ok. details of jacoco which i have used in my project. jacoco version : jacoco-0.6.2.201302030002 plugin version : 1.0.19 thanks Shweta

          Philip Aston added a comment -

          If it's the same issue, the only workaround I've found is to ensure that no two modules have a file with the same path. In your case, it looks like the file "Application" appears in more than one module.

          Philip Aston added a comment - If it's the same issue, the only workaround I've found is to ensure that no two modules have a file with the same path. In your case, it looks like the file "Application" appears in more than one module.

          shweta G added a comment -

          Hi,
          Thank you for your reply.

          Yes, Application is file present in 2 modules with the same path. And they are source files.
          How do i pass these two modules separately?
          is there any way to exclude them ?

          Thank you,
          Shweta

          shweta G added a comment - Hi, Thank you for your reply. Yes, Application is file present in 2 modules with the same path. And they are source files. How do i pass these two modules separately? is there any way to exclude them ? Thank you, Shweta

          Philip Aston added a comment -

          The only option I've found is to make sure the file paths are unique across all modules.

          The problem occurs when the plugin copies the module sources up to the master so the combined coverage report can be generated. No filter is applied to this process. If there are non-unique files, this problem occurs.

          Philip Aston added a comment - The only option I've found is to make sure the file paths are unique across all modules. The problem occurs when the plugin copies the module sources up to the master so the combined coverage report can be generated. No filter is applied to this process. If there are non-unique files, this problem occurs.

            ognjenb Ognjen Bubalo
            philipa Philip Aston
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: