Published on October 17, 2015
Author Lars Kruse
Notice: This post is more than a year old. Some of the content might be outdated.

LinkChecker - Jekyll flavor

UPDATE: Updated alongside the parser, now picks up warnings with newlines in their messages.

This parser is designed to parse the CSV output from LinkChecker. It assumes that the source of the website that is being parsed is available in the _site directory of the workspace. _site is the Jekyll default, but it can be overridden.

Example: Say that you’re hosting from the master branch Set up a job that:

pull master
jekyll build
linkchecker -o text -Fcsv/report/

Let the Warnings plugin scan the generated report/ using this parser.

Settings for the Warnings plugin


LinkChecker CSV (Jekyll flavor)

Jekyll LinkChecker

Trend report Name

Jekyll LinkChecker Trend

Regular expression

The following regex is pretty daunting, but it allows for greater customization of the warnings later on.


Mapping script

The import of hudson.plugins.analysis.util.model.Priority is necessary if you want to get access to the Warning constructor that takes five arguments - the last being the priority.

import hudson.plugins.analysis.util.model.Priority
import hudson.plugins.warnings.parser.Warning

def obj = [
        url          :,
        parentUrl    :,
        baseRef      :,
        result       :,
        infoString   :,
        valid        :,
        fullUrl      :,
        line         :,
        column       :,
        name         :,
        dlTime       :,
        dlSize       :,
        checkTime    :,
        cached       :,
        level        :,
        modified     :

String jekyllTarget = "_site"
String defaultIndex = "index.html"
String source = obj.parentUrl
if (source ==~ /https?:\/\/[^\s\.].[^\s\/]*$/)
    source = $ { source } $ { "/" }
if (source ==~ /.*\/$/)
    source = $ { source } $ { defaultIndex }
source = source.replaceAll(/https?:\/\/[^\s\.].[^\s\/]*/, jekyllTarget)

def line = obj.line.toInteger()
def type = obj.level
def category = obj.result

message = "$obj.fullUrl: ($obj.result) $obj.warningString - $obj.infoString"

def priority = Priority.NORMAL
if (obj.valid.equalsIgnoreCase("true"))
    priority = Priority.LOW
if (obj.valid.equalsIgnoreCase("false"))
    priority = Priority.HIGH

return new Warning(source, line, type, category, message, priority)

Related Stories

Related Stories


20 Jira tips to make your day easier

Jira Software is a powerful tool deployed in so many organizations, yet in day to day usage people are missing out on improvements, big and small.

Get started with Serverless Jenkins X

A crash course in Jenkins X and how to test it out on a local Kubernetes cluster