Jenkins: XUnitPublisher aborted due to exception. The types section is required.

Jenkins is an extendable open source continuous integration (CI) server, developed by Sun Microsystems and also known as the former Hudson project. A CI toolchain helps you automate repetitive tasks such as compiling your software, executing test runners and emailing you reports.

Jenkins is using XML to describe what a specific task should look like. In order to run your unit tests the xunit plugin integrates a unit testing framework, e.g. PHPUnit, with your CI environment. Sometimes the plugin fails to save its settings correctly and you’ll get the XUnitPublisher aborting due to missing type definitions.

ERROR: Publisher org.jenkinsci.plugins.xunit.XUnitPublisher aborted due to exception
java.lang.NullPointerException: The types section is required.
    at org.jenkinsci.plugins.xunit.XUnitProcessor.(
    at org.jenkinsci.plugins.xunit.XUnitPublisher.perform(
    at hudson.tasks.BuildStepMonitor$1.perform(
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(
    at hudson.model.Build$BuildExecution.post2(
    at hudson.model.AbstractBuild$
    at hudson.model.Run.execute(
    at hudson.model.ResourceController.execute(
Finished: FAILURE

The above error message clearly says that in your /var/lib/jenkins/jobs/your-actual-job/config.xml the types section is missing and Jenkins is right. Open this file and go to the publishers section, here you add the types section, as highlighted in the code example below, as a child to the XML node xunit.

    <xunit plugin="xunit@1.91">

If you use another testing framework than PHPUnit click here to find more about the supported types or try one of the following list.

  • AUnitJunitHudsonTestType
  • BoostTestJunitHudsonTestType
  • CTestType
  • CppTestJunitHudsonTestType
  • CppUnitJunitHudsonTestType
  • JUnitType
  • NUnitJunitHudsonTestType
  • PHPUnitJunitHudsonTestType

1 Comment

  1. I am wearing it,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>