So here's what I see: 1) It looks like the analysis is done
[INFO] --- jacoco-maven-plugin:0.7.7.201606060606:report (post-unit-test) @ proj-test --- [INFO] Loading execution data file /home/username/builds/projName/proj-java/proj-test/target/jacoco.exec [INFO] Analyzed bundle 'Project Name Test' with 254 classes [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ proj-test --- [INFO] Building jar: /home/username/builds/projName/proj-java/proj-test/target/proj-test-2.3.2.jar [INFO] [INFO] --- jacoco-maven-plugin:0.7.7.201606060606:report (default-cli) @ proj-test --- [INFO] Loading execution data file /home/username/builds/projName/proj-java/proj-test/target/jacoco.exec [INFO] Analyzed bundle 'Project Name Test' with 254 classes 2) Using default locations, when I attemp to Record JaCoCo coverage, I get an exception that the /home/username/.jenkins/jobs/32_projName/builds/2017-06-30_14-52-07/jacoco/classes directory does not exist. I also noticed that /home/username/.jenkins/jobs/32_projName/builds/2017-06-30_14-52-07/ doesn't have the jacoco,exec file. So I added this script (at least temporarily): + mkdir -p /home/username/.jenkins/jobs/32_projName/builds/2017-06-30_14-52-07/jacoco/classes + cp /home/username/builds/projName/folder1/proj-test/target/jacoco.exec /home/username/.jenkins/jobs/32_projName/builds/2017-06-30_14-52-07/jacoco/classes 3) Now, I don't get the exception about the directory not existing but even with the exec file copied over, it doesn't seem to find it: [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] Loading inclusions files.. [JaCoCo plugin] inclusions: [] [JaCoCo plugin] exclusions: [] [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0] [JaCoCo plugin] Publishing the results.. [JaCoCo plugin] Loading packages.. [JaCoCo plugin] Done. [JaCoCo plugin] Overall coverage: class: 100, method: 100, line: 100, branch: 100, instruction: 100 So a few questions: 1. Why does it not say it finds the exec file? Does it need to also find the classes and/or source at the same time to load? 2. Why don't the directories get created for jacoco/classes automatically in the build directory? Steve On Tuesday, June 27, 2017 at 3:01:00 AM UTC-4, Dominik Stadler wrote: > > The configured directories should be relative to the base working > directory of the build/job, you can also try to use something like > **/*.exec and see if that works as this will scan the whole workspace of > the job for .exec files. > > Dominik. > > On Mon, Jun 26, 2017 at 6:57 PM, Steve Wardell <[email protected] > <javascript:>> wrote: > >> It writes the exec file, but when I add a post build action to Record >> Jacoco coverage report, it fails to pick-up the files as it looks like it >> goes to a different directory hierarchy. I sanitized the usernames, project >> names, etc in this log. Any assistance would be appreciated. I had limited >> the tests run for debugging. Let me know if you have any questions. One >> note, the "../../../../../../.." was me attempting to configure the Record >> JaCoCo coverage to go to the directory where the exec file is. >> >> Thanks, >> Steve >> >> Log (sanitized) >> Executing Maven: -B -f >> /home/username/builds/DevInt_ProdFix/projectName/proj-test/pom.xml -s >> /home/username/maven/conf/settings.xml -gs >> /home/username/maven/conf/settings.xml clean jacoco:prepare-agent test >> package -Dtest=SecurityTest >> >> >> >> [INFO] --- jacoco-maven-plugin:0.7.7.201606060606:prepare-agent >> (default-cli) @ proj-test --- >> >> [INFO] argLine set to >> -javaagent:/home/username/maven-repo/org/jacoco/org.jacoco.agent/0.7.7. >> 201606060606/org.jacoco.agent-0.7.7.201606060606-runtime.jar=destfile=/home/username/builds/DevInt_ProdFix/projectName/proj-test/target/jacoco.exec >> >> [INFO] >> >> [INFO] --- maven-resources-plugin:2.7:copy-resources (copy-resources) @ >> proj-test --- >> >> [INFO] Using 'UTF-8' encoding to copy filtered resources. >> >> [INFO] Copying 113 resources >> >> [INFO] >> >> [INFO] --- jacoco-maven-plugin:0.7.7.201606060606:prepare-agent >> (pre-unit-test) @ proj-test --- >> >> [INFO] surefireArgLine set to >> -javaagent:/home/username/maven-repo/org/jacoco/org.jacoco.agent/0.7.7. >> 201606060606/org.jacoco.agent-0.7.7.201606060606-runtime.jar=destfile=/home/username/builds/DevInt_ProdFix/projectName/proj-test/target/coverage-reports/jacoco-ut.exec >> >> >> >> [INFO] --- jacoco-maven-plugin:0.7.7.201606060606:report (post-unit-test) >> @ proj-test --- >> >> [INFO] Loading execution data file >> /home/username/builds/DevInt_ProdFix/projectName/proj-test/target/coverage-reports/jacoco-ut.exec >> >> [INFO] Analyzed bundle 'Project Name Test' with 0 classes >> >> [INFO] >> >> [INFO] --- maven-resources-plugin:2.7:copy-resources (copy-resources) @ >> proj-test --- >> >> [INFO] Using 'UTF-8' encoding to copy filtered resources. >> >> [INFO] Copying 113 resources >> >> [INFO] >> >> [INFO] --- jacoco-maven-plugin:0.7.7.201606060606:prepare-agent >> (pre-unit-test) @ proj-test --- >> >> [INFO] surefireArgLine set to >> -javaagent:/home/username/maven-repo/org/jacoco/org.jacoco.agent/0.7.7. >> 201606060606/org.jacoco.agent-0.7.7.201606060606-runtime.jar=destfile=/home/username/builds/DevInt_ProdFix/projectName/proj-test/target/coverage-reports/jacoco-ut.exec >> >> >> >> [INFO] --- jacoco-maven-plugin:0.7.7.201606060606:report (post-unit-test) >> @ proj-test --- >> >> [INFO] Loading execution data file >> /home/username/builds/DevInt_ProdFix/projectName/proj-test/target/coverage-reports/jacoco-ut.exec >> >> >> >> [INFO] Analyzed bundle 'Project Name Test' with 0 classes >> >> >> >> [JaCoCo plugin] Collecting JaCoCo coverage data... >> >> [JaCoCo plugin] >> ../../../../../../../builds/DevInt_ProdFix/projectName/proj-test/target/coverage-reports/jacoco-ut.exec;../../../../../../../builds/DevInt_ProdFix/projectName/**/classes;../../../../../../../builds/DevInt_ProdFix/projectName/**/src/main/java; >> >> locations are configured >> >> [JaCoCo plugin] Number of found exec files: 0 >> >> [JaCoCo plugin] Saving matched execfiles: >> >> [JaCoCo plugin] Saving matched class directories: >> >> [JaCoCo plugin] Saving matched source directories: >> >> [JaCoCo plugin] Loading inclusions files.. >> >> [JaCoCo plugin] inclusions: [] >> >> [JaCoCo plugin] exclusions: [] >> >> ERROR: Publisher hudson.plugins.jacoco.JacocoPublisher aborted due to >> exception >> >> java.lang.IllegalStateException: basedir >> /home/username/.jenkins/jobs/BuildName/builds/2017-06-23_21-12-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) >> >> >> >> >> >> POM Excerts >> >> <jacoco.version>0.7.7.201606060606</jacoco.version> >> >> >> >> <plugin> >> >> <groupId>org.jacoco</groupId> >> >> <artifactId>jacoco-maven-plugin</artifactId> >> >> <version>${jacoco.version}</version> >> >> <executions> >> >> <execution> >> >> <id>pre-unit-test</id> >> >> <goals> >> >> <goal>prepare-agent</goal> >> >> </goals> >> >> </execution> >> >> <execution> >> >> <id>post-unit-test</id> >> >> <phase>test</phase> >> >> <goals> >> >> <goal>report</goal> >> >> </goals> >> >> </execution> >> >> </executions> >> >> </plugin> >> >> >> >> Running target >> >> clean jacoco:prepare-agent test package >> >> >> >> >> On Mon, Jun 26, 2017 at 8:00 AM, Dominik Stadler <[email protected] >> <javascript:>> wrote: >> > >> > Can you provide the full build-log from jenkins, at least the part >> where the jacoco-plugin performs it's work? And how does the configuration >> of the jacoco-plugin your job look like? >> > >> > Thanks... Dominik. >> > >> > On Sat, Jun 24, 2017 at 4:50 AM, Steve Wardell <[email protected] >> <javascript:>> wrote: >> >> >> >> I'm running an older version, 1.0.16, in Jenkins 1.588 due to approved >> version limitations. It looks like the jacoco plugin (0.7.7.201606060606) >> writes the exec under the /home/username/builds/projectName/<etc>. When I >> add the post-build-action to Record JaCoCo coverage report and run the >> build, the number of exec files found is 0. And then I get an exception: >> >> >> >> ERROR: Publisher hudson.plugins.jacoco.JacocoPublisher aborted due to >> exception java.lang.IllegalStateException: basedir >> /home/username/.jenkins/jobs/<build name>/builds/<unique >> build>/jacoco/classes does not exist >> >> >> >> Any thoughts on why the mismatch of hierarchy of builds vs jobs? >> >> >> >> Thanks, >> >> Steve >> >> >> >> -- >> >> Azért kapta ezt az üzenetet, mert feliratkozott a Google Csoportok >> „Jenkins JaCoCo plugin mailing list” csoportjára. >> >> Az erről a csoportról és az ahhoz kapcsolódó e-mailekről való >> leiratkozáshoz küldjön egy e-amailt a(z) >> [email protected] >> <javascript:> címre. >> >> Ha üzenetet szeretne küldeni ebbe a csoportba, küldjön e-mailt a(z) >> [email protected] <javascript:> címre. >> >> További lehetőségekért látogasson el ide: >> https://groups.google.com/d/optout. >> > >> > >> > -- >> > Azért kapta ezt az üzenetet, mert feliratkozott a Google Csoportok >> „Jenkins JaCoCo plugin mailing list” témájára. >> > A témáról való leiratkozáshoz látogasson el a következő címre: >> https://groups.google.com/d/topic/jenkins-jacoco-plugin-mailing-list/aNz-9t0FZTs/unsubscribe >> . >> > Az erről a csoportról és minden témájáról való leiratkozáshoz küldjön >> egy levelet a következő címre: >> [email protected] >> <javascript:>. >> > Ha üzenetet szeretne küldeni ebbe a csoportba, küldjön e-mailt a(z) >> [email protected] <javascript:> címre. >> > További lehetőségekért látogasson el ide: >> https://groups.google.com/d/optout. >> >> -- >> Azért kapta ezt az üzenetet, mert feliratkozott a Google Csoportok >> „Jenkins JaCoCo plugin mailing list” csoportjára. >> Az erről a csoportról és az ahhoz kapcsolódó e-mailekről való >> leiratkozáshoz küldjön egy e-amailt a(z) >> [email protected] >> <javascript:> címre. >> Ha üzenetet szeretne küldeni ebbe a csoportba, küldjön e-mailt a(z) >> [email protected] <javascript:> címre. >> További lehetőségekért látogasson el ide: >> https://groups.google.com/d/optout. >> > > -- Azért kapta ezt az üzenetet, mert feliratkozott a Google Csoportok szolgáltatásbeli Jenkins JaCoCo plugin mailing list csoportra. Az erről a csoportról és az ahhoz kapcsolódó e-mailekről való leiratkozáshoz küldjön egy e-amailt a(z) [email protected] címre. Ha üzenetet szeretne küldeni ebbe a csoportba, küldjön egy e-mailt a(z) [email protected] címre. További lehetőségekért látogasson el a(z) https://groups.google.com/d/optout címre.
