Fixing a Jenkins 1.5 Slave on Windows 2016

Monday 2018-01-01

Jenkins is one funny butler.

When you configure a Jenkins 1.5x slave on a Windows 2016 machine according to the instructions on wiki.jenkins-ci.org you will probably get a warning that the .Net 2.0 is not available. This is reported as issue 21484 and the fix is to upgrade, which sometimes can be a problem.

If you can’t upgrade to the latest version for whatever reason, you can easily fix the .Net problem by changing the jenkins-slave.exe.config file from:

<configuration>
  <runtime>
    <generatePublisherEvidence enabled="false"/>
  </runtime>
</configuration>

To:

<!-- see http://support.microsoft.com/kb/936707 -->
<configuration>
  <runtime>
    <generatePublisherEvidence enabled="false"/>
  </runtime>
  <startup>
  	 <supportedRuntime version="v2.0.50727" />
     <supportedRuntime version="v4.0" />
  </startup>
</configuration>

Hope this works for you. Cheers!


Why Jenkins does not detect Failures

Monday 2011-06-20

Jenkins, the brilliant Continuous Integration build server, has a bit of a problem with the Maven surefire jUnit test plugin. Last sunday, I discovered that our Jenkins build server suddenly started ignoring test failures. While the logfile clearly states that the Unittests contain failures, Jenkins marks the builds as “stable”.

After some digging around, I found that even though Jenkins explicitly tells you in the logfile that it will fail the build, it will not do so if the Surefire XML reports are not generated. In our case, somebody in the team decided that the generation of the XML Surefire reports was taking too long and had disabled them in the Maven pom.xml.

In order to solve this, I re-enabled the XML reports and voila, Jenkins happily started reporting errors again. Here is the correct Surefire plugin configuration for you to use in your maven pom.xml file:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.8</version>
    <configuration>

      <!-- Please note that Jenkins needs Surefire
           XML reports in order for detection to work.
           Keep this property set to false. -->
      <disableXmlReport>false</disableXmlReport>
    </configuration>
</plugin>