[JIRA] (JENKINS-53411) Jacoco Plugin 3.0.3 fails build when no Jacoco exec files were available

4 views
Skip to first unread message

jenkins@adamcc.ch (JIRA)

unread,
Sep 4, 2018, 10:23:03 AM9/4/18
to jenkinsc...@googlegroups.com
Adam Crowther created an issue
 
Jenkins / Bug JENKINS-53411
Jacoco Plugin 3.0.3 fails build when no Jacoco exec files were available
Issue Type: Bug Bug
Assignee: Ognjen Bubalo
Attachments: systemInfo.csv
Components: jacoco-plugin
Created: 2018-09-04 14:22
Environment: Jenkins 2.121.3
Jacoco 3.0.3

Ubuntu Version: 16.04.5 LTS

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

Priority: Major Major
Reporter: Adam Crowther

I have a Maven parent pom.xml which combines Java and non-Java builds.  Non-Java builds are built using maven plugins.  (The parent pom references child submodule in a profile for convenience, when I need to build everything, but these are not used during the release process).

  • The parent module has <packaging>pom</packaging>, and it contains no java, so no coverage -.exec file is generated. 
  • Some of the child modules are standard Java, with unit test etc. 
  • Some of the child modules are Javascript - the pom uses plugins to trigger the npm build script, assembles the webpacked artefacts to a ZIP file, and uploads it to our nexus.  No coverage -.exec file is generated.

I have a single, generic build process for each of these types of module.

Since Version 3.0.1, JaCoCo is failing my build when no exec files are found, with the following exception:  

ERROR: Build step failed with exception java.lang.IllegalStateException: basedir /var/lib/jenkins/jobs/releases/jobs/Release/builds/19/jacoco/classes does not exist

 

[JaCoCo plugin] Collecting JaCoCo coverage data...
[JaCoCo plugin] **/**.exec;**/classes;**/src/main/java; locations are configured
[JaCoCo plugin] Number of found exec files for pattern **/**.exec: 0
[JaCoCo plugin] Saving matched execfiles: 
[JaCoCo plugin] Saving matched class directories for class-pattern: **/classes: 
[JaCoCo plugin] Saving matched source directories for source-pattern: **/src/main/java: 
[JaCoCo plugin] Source Inclusions: null
[JaCoCo plugin] Source Exclusions: null
[JaCoCo plugin] Loading inclusions files..
[JaCoCo plugin] inclusions: []
[JaCoCo plugin] exclusions: []
ERROR: Build step failed with exception
java.lang.IllegalStateException: basedir /var/lib/jenkins/jobs/releases/jobs/Release/builds/19/jacoco/classes does not exist
 at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:281)
 at org.codehaus.plexus.util.FileUtils.getFileAndDirectoryNames(FileUtils.java:1940)
 at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1868)
 at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1850)
 at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1825)
 at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1808)
 at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:124)
Caused: java.lang.RuntimeException: While reading class directory: /var/lib/jenkins/jobs/releases/jobs/Release/builds/19/jacoco/classes
 at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:131)
 at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:137)
 at hudson.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:110)
 at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:339)
 at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:326)
 at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:657)
 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1073)
 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
 at hudson.model.Run.execute(Run.java:1823)
 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
 at hudson.model.ResourceController.execute(ResourceController.java:97)
 at hudson.model.Executor.run(Executor.java:429)

Shouldn't the plugin simply do nothing when there are no exec files to process?

If this is deemed to be a feature rather than a bug, then I request a configuration that controlls the behaviour, usable both from the UI "Record JaCoCo coverage report" form and also from the Groovy API, for use in pipeline steps.

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jenkins@adamcc.ch (JIRA)

unread,
Sep 4, 2018, 10:26:01 AM9/4/18
to jenkinsc...@googlegroups.com
Adam Crowther commented on Bug JENKINS-53411
 
Re: Jacoco Plugin 3.0.3 fails build when no Jacoco exec files were available

This ticket references the same problem in the comments at the bottom.  The last comment in that thread is:

 
centic added a comment - 2018-04-25 17:59
"You are welcome to send a PR for this, the code and the change is not complicated, the plugin is just short on active maintainers..."

jenkins@adamcc.ch (JIRA)

unread,
Sep 4, 2018, 10:27:02 AM9/4/18
to jenkinsc...@googlegroups.com
Adam Crowther edited a comment on Bug JENKINS-53411
This ticket Ticket JENKINS-49823 (linked) references the same problem in the comments at the bottom.  The last comment in that thread is:

 
[~centic] added a comment - 2018-04-25 17:59

"You are welcome to send a PR for this, the code and the change is not complicated, the plugin is just short on active maintainers..."
Reply all
Reply to author
Forward
0 new messages