Wren CallowayBackplane Journal

Jenkins NAnt Build Pipeline: A Setup for .NET Teams

A Jenkins NAnt build pipeline still holds up: the NAnt build step, five targets worth wiring up, and what to check when the plugin falls behind.

Wren Calloway

A Jenkins NAnt build pipeline is the shortest route for a .NET Framework shop that already keeps its build logic in build.xml: one job calls NAnt, the build file splits the work into stages, and the controller handles scheduling and archiving. The parts are older than most readers expect. NAnt’s newest release is 0.92 from June 9, 2012 (NAnt release notes, October 2026), and the Jenkins NAnt plugin that supplies the build step now requires Jenkins 2.361.4 (plugins.jenkins.io, October 2026). NAnt’s own documentation still describes a build file as an XML project of targets and tasks, which is why pipeline stages map cleanly onto target names.

What a Jenkins NAnt build pipeline needs before the first build

A Jenkins NAnt build pipeline needs three things: a controller on supported Java, an agent with NAnt on its PATH, and a build file in source control.

The controller moves faster than the build side. Per the Jenkins Java Support Policy (October 2026), Java 21 first shipped in LTS 2.479.1 in October 2024 and is supported through September 2027.

Java on the controller First LTS release Status as of October 2026
Java 21 2.479.1 (October 2024) Supported until September 2027
Java 25 2.541.1 (January 2026) Supported
Java 17 2.346.1 (June 2022) Final LTS 2.541.3 (March 2026)
Java 11 2.164.1 (March 2019) Final LTS 2.462.3 (October 2024)

Install NAnt on the agent from the binary zip. Its installation page says to delete or rename any previous NAnt directory first, then run nant -help in a fresh shell (NAnt documentation v0.92, October 2026).

How does a Jenkins job call NAnt?

A Jenkins job calls NAnt through the NAnt plugin’s “Top Level NAnt Target” build step, which looks for NAnt.exe on Windows and nant elsewhere (plugins.jenkins.io, October 2026).

A build file path entered in that step is relative to the workspace root, so keep build.xml at the repository top. In a freestyle job, stages map onto targets:

  1. clean — delete bin and obj output with failonerror="false", so a missing directory does not fail the build.
  2. compile — run the compiler tasks and write the assemblies to one output directory.
  3. test — run the test assemblies and publish the results as a JUnit report.
  4. package — zip the assemblies into one artifact and archive it from Jenkins.
  5. publish — copy that artifact to the target share, where the running application logs through Log4Net.

Switch modes with -D:debug=false only after a clean, because compiler tasks skip work when the output is newer than its sources (NAnt documentation v0.92, October 2026).

Jenkins NAnt build pipeline: chained jobs or one Jenkinsfile?

A Jenkins NAnt build pipeline in a Jenkinsfile keeps all five stages in one source-controlled file (Jenkins handbook, October 2026). Jenkins reads it as pipeline, node and stage blocks:

pipeline {
  agent any
  stages {
    stage('Compile') {
      steps { bat 'nant -D:debug=false compile' }
    }
    stage('Test') {
      steps { bat 'nant test' }
    }
    stage('Publish') {
      steps { bat 'nant package publish' }
    }
  }
}

Use bat on a Windows agent and sh on a Linux agent running Mono; the plugin documents both paths (October 2026). The node block allocates the workspace, and the handbook notes that some workspaces are never cleaned automatically (JENKINS-2111).

What a failure looks like in the log is set by the C# code throwing, so C# exception handling matters more here than in most stages.

Why does old Jenkins configuration for NAnt builds still say Hudson?

Old Jenkins configuration still says Hudson because the project renamed itself in early 2011, when community developers voted 214 to 14 to rename it (InfoQ, January 31, 2011).

The trigger was a trademark: Andrew Bayer wrote on the Jenkins project blog on January 11, 2011 that Oracle had applications filed in the US and EU and could withdraw the right to the name. Oracle’s engineer Winston Prakash, posting on the Hudson home page, put it more plainly, as InfoQ quoted him in January 2011: “Your current installations will continue to run fine, and you won’t need to change any code.”

Is a Jenkins NAnt build pipeline still worth wiring up in 2026?

A Jenkins NAnt build pipeline still earns its keep on an existing build file, with NAnt 0.92 dated June 9, 2012 the newest release (NAnt release notes, October 2026).

NAnt release Date What changed
0.90 May 8, 2010 The tar task creates missing base directories
0.91 October 22, 2011 XmlPeek and app.config fixes
0.92-rc1 May 23, 2012 xmlpoke honors failonerror; trycatch and choose move into core
0.92 June 9, 2012 No changes since 0.92-rc1
GitHub project No tagged release as of October 2026 nant/nant lists none

The plugin that supplies the build step is thin. Its last changelog entry is version 1.4.3 from November 1, 2012, it sits on 0.51% of controllers, and the plugin page lists it as up for adoption (plugins.jenkins.io, October 2026).

For a codebase with no NAnt script yet, I would not write one, because nothing in this wiring needs NAnt specifically. When publish fails, send the build log somewhere people watch, such as Graylog2 alerting, instead of waiting for someone to open the console page.

Jenkins NAnt build pipeline FAQ

What does a Jenkins NAnt build pipeline need on the agent before the first build runs?

It needs NAnt on the agent’s PATH and a build file in the workspace. The plugin runs NAnt.exe on Windows and nant on other operating systems, and it resolves the build file path from the workspace root (plugins.jenkins.io, October 2026). The controller must also run a supported Java version: the Jenkins Java Support Policy, October 2026, lists Java 21 as supported until September 2027.

Should a Jenkins NAnt build pipeline use chained freestyle jobs or a Jenkinsfile?

Use a Jenkinsfile for anything you have to maintain. Chaining freestyle jobs worked in 2011 and still runs, but that pipeline definition lives in job configuration in the UI instead of in the repository. A Jenkinsfile stages the same NAnt targets from source control, which is the arrangement the Jenkins handbook describes as Pipeline-as-code (October 2026).

Why does a Jenkins NAnt build pipeline configuration from 2011 still load today?

Because Jenkins kept the Hudson job format when the project renamed itself. Developers voted 214 to 14 for the rename, and Oracle’s engineer Winston Prakash wrote on the Hudson home page, quoted by InfoQ in January 2011: “Your current installations will continue to run fine, and you won’t need to change any code.” Jobs saved before the rename keep loading.

Is NAnt maintained enough to trust in a Jenkins build pipeline?

Only when the build file already exists. NAnt 0.92, released June 9, 2012, is still the newest release, and the nant/nant GitHub project lists no tagged release as of October 2026. The Jenkins NAnt plugin’s last changelog entry is version 1.4.3 from November 1, 2012, and the plugin page lists it as up for adoption.

#Jenkins#NAnt#Build Pipeline#Continuous Integration#.NET

Related articles