JaCoCo Web Report Not Rendering Properly in GitHub Pages


When pushing JaCoCo web report to GitHub’s gh-pages branch, it does not render properly on the web. For example:-

The GitHub pages are powered by Jekyll. By default, Jekyll does not allow directories or files that begin with a dot, pound sign, tilde or underscore.

Since JaCoCo places all the image and CSS files in a directory called .resources, this directory will not be pushed to GitHub’s gh-pages branch.


GitHub Site Plugin has a noJekyll parameter that will create the .nojekyll file at the root path if it is set to true.

        <message>Creating site for ${project.version}</message>

SOLUTION 1: Disable Jekyll

One simple fix is to completely disable Jekyll by creating an empty file called .nojekyll at this location:-

├── pom.xml
├── src
│   ├── main
│   │   └── java
│   │       └── ...
│   ├── site
│   │   └── resources
│   │       └── .nojekyll

SOLUTION 2: Configure Jekyll

While disabling Jekyll works, it may 1) seem rather risky since there maybe other hidden directories/files and 2) possibly send too much garbage to GitHub’s gh-pages branch.

To fix this, we will instruct Jekyll to allow JaCoCo’s .resources directory through by creating a file called _config.yml at this location:-

├── pom.xml
├── src
│   ├── main
│   │   └── java
│   │       └── ...
│   ├── site
│   │   └── resources
│   │       └── _config.yml

In _config.yml, enter the following:-

# Allow JaCoCo's directory to bypass GitHub's Jekyll-powered pages
# so that the web report renders properly
include: ['.resources']


Either solution will produce a nicely rendered JaCoCo web report in GitHub pages.

Intellij v13.1 Bug: NoClassDefFoundError when Running Unit Test With JaCoCo Configured

If you are using IntelliJ and your Maven project relies on JaCoCo Maven Plugin, please consider voting up issue IDEA-122895 to get it fixed by JetBrain as soon as possible.

Even if you are not using IntelliJ or JaCoCo, but you find this shitty blog to be helpful, please consider voting up this issue to help this poor author. You will be rewarded with a thousand colorful unicorns that will help to troubleshoot your future programming obstacles.

Here’s how to do it…

Step 1

Visit IDEA-122895.

Step 2

Log into JetBrain’s YouTrack.

Step 3

Click on the vote button at the bottom of the page.

Step 4

Rejoiced! … and wait for the flying “problem-solving” colorful unicorns to arrive in 3 business days…