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

Jacoco with Jenkins on Apache Tomcat: /jacoco/classes does not exist

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • jacoco-plugin
    • None

      Ubuntu 14.04
      Gradle 2.2.1
      Jenkins 1.609
      jacoco Jenkins plugin:1.0.19

          [JENKINS-27766] Jacoco with Jenkins on Apache Tomcat: /jacoco/classes does not exist

          Mark Forgues added a comment - - edited

          I am using jacoco 1.0.16 with Jenkins on a Apache Tomcat Server. The project I am building is a multiple module project using Maven. I build a parent project which then kicks off the test project (that has all the test classes). I get the error:

          ERROR: Publisher hudson.plugins.jacoco.JacocoPublisher aborted due to exception
          java.lang.IllegalStateException: basedir /home/irsmoper/.jenkins/jobs/irsm-test/builds/2015-03-19_13-59-11/jacoco/classes does not exist
          at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:550)
          at org.codehaus.plexus.util.FileUtils.getFileAndDirectoryNames(FileUtils.java:1717)
          at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1645)
          at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1627)
          at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1601)
          at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1584)
          at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:128)
          at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:137)
          at hudson.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:102)
          at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:291)
          at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:273)
          at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:371)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
          at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1037)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
          at hudson.model.Run.execute(Run.java:1784)
          at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
          at hudson.model.ResourceController.execute(ResourceController.java:89)
          at hudson.model.Executor.run(Executor.java:240)

          I have tried to move files into the correct folders, but Jacoco keeps looking in that build folder, but the info it needs is in a different folder with source. When i moved the exec file into the correct folder, the build would complete, but no code coverage information was generated, and the console would still display:

          [JaCoCo plugin] Number of found exec files: 0

          I also tried pointing jacoco to the correct folders using ../../.. etc but it still did not work.

          Mark Forgues added a comment - - edited I am using jacoco 1.0.16 with Jenkins on a Apache Tomcat Server. The project I am building is a multiple module project using Maven. I build a parent project which then kicks off the test project (that has all the test classes). I get the error: ERROR: Publisher hudson.plugins.jacoco.JacocoPublisher aborted due to exception java.lang.IllegalStateException: basedir /home/irsmoper/.jenkins/jobs/irsm-test/builds/2015-03-19_13-59-11/jacoco/classes does not exist at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:550) at org.codehaus.plexus.util.FileUtils.getFileAndDirectoryNames(FileUtils.java:1717) at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1645) at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1627) at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1601) at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1584) at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:128) at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:137) at hudson.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:102) at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:291) at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:273) at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:371) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1037) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683) at hudson.model.Run.execute(Run.java:1784) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) I have tried to move files into the correct folders, but Jacoco keeps looking in that build folder, but the info it needs is in a different folder with source. When i moved the exec file into the correct folder, the build would complete, but no code coverage information was generated, and the console would still display: [JaCoCo plugin] Number of found exec files: 0 I also tried pointing jacoco to the correct folders using ../../.. etc but it still did not work.

          Same with me on Ubuntu 14.04, I get empty Code Coverage View but I get coverage with index.html published using HTML publisher plugin.
          ERROR: Build step failed with exception
          java.lang.IllegalStateException: basedir /var/lib/jenkins/jobs/Android_Build_TestCC/builds/22/jacoco/classes does not exist
          at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:550)
          at org.codehaus.plexus.util.FileUtils.getFileAndDirectoryNames(FileUtils.java:1717)
          at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1645)
          at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1627)
          at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1601)
          at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1584)
          at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:124)
          at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:133)
          at hudson.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:102)
          at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:291)
          at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:273)
          at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:371)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
          at hudson.model.Build$BuildExecution.post2(Build.java:183)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
          at hudson.model.Run.execute(Run.java:1766)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:98)
          at hudson.model.Executor.run(Executor.java:374)
          Build step 'Record JaCoCo coverage report' marked build as failure
          Finished: FAILURE

          Maninder Singh added a comment - Same with me on Ubuntu 14.04, I get empty Code Coverage View but I get coverage with index.html published using HTML publisher plugin. ERROR: Build step failed with exception java.lang.IllegalStateException: basedir /var/lib/jenkins/jobs/Android_Build_TestCC/builds/22/jacoco/classes does not exist at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:550) at org.codehaus.plexus.util.FileUtils.getFileAndDirectoryNames(FileUtils.java:1717) at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1645) at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1627) at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1601) at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1584) at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:124) at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:133) at hudson.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:102) at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:291) at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:273) at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:371) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670) at hudson.model.Run.execute(Run.java:1766) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374) Build step 'Record JaCoCo coverage report' marked build as failure Finished: FAILURE

          FWIW, I seem to be getting this error when the job config provides a "classes dir" that does not exist in my workspace (or is not created by the build).
          It is annoying that it would crash an otherwise good build simply because this configuration is incorrect. Other plugin handles this more gracefully with a simple warning rather than a build breaking exception.
          this even occurs when the plugin couldn't even find .exec files to begin with (so it shouldn't have to worry about the classes dir, or generating the report right ?)

          Patrice Matignon added a comment - FWIW, I seem to be getting this error when the job config provides a "classes dir" that does not exist in my workspace (or is not created by the build). It is annoying that it would crash an otherwise good build simply because this configuration is incorrect. Other plugin handles this more gracefully with a simple warning rather than a build breaking exception. this even occurs when the plugin couldn't even find .exec files to begin with (so it shouldn't have to worry about the classes dir, or generating the report right ?)

          Closed as duplicate of JENKINS-19916.

          Martin Heinzerling added a comment - Closed as duplicate of JENKINS-19916 .

            ognjenb Ognjen Bubalo
            mforgues Mark Forgues
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: