Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Revert "Update ant to v1.10.16"#26606

Merged
timja merged 1 commit into
jenkinsci:masterfrom
MarkEWaite:fix-windows-test-failures-in-ant-FileUtils
Apr 10, 2026
Merged

Revert "Update ant to v1.10.16"#26606
timja merged 1 commit into
jenkinsci:masterfrom
MarkEWaite:fix-windows-test-failures-in-ant-FileUtils

Conversation

@MarkEWaite
Copy link
Copy Markdown
Contributor

@MarkEWaite MarkEWaite commented Apr 10, 2026

Revert "Update ant to v1.10.16"

Fix a Windows bug introduced by the update to Apache Ant 1.10.16. The unreleased Apache Ant 1.10.17 What's New describes bug 69992 as:

The JavaEnvUtils and FileUtils classes statically depend on each other since Ant 1.10.16 making it impossible to load JavaEnvUtils without loading FileUtils first causing NullPointerException for programmatic use on Windows. This affected Eclipse and may also affect other projects using Ant as a library.

The Eclipse project discusses it in detail in eclipse-platform/eclipse.platform#2605 (comment)

Automated tests on ci.jenkins.io Windows agents have been failing since 3 Apr 2026. The failures report a stack trace:

Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.tools.ant.util.DeweyDecimal.compareTo(org.apache.tools.ant.util.DeweyDecimal)" because "org.apache.tools.ant.util.JavaEnvUtils.parsedJavaVersion" is null
	at org.apache.tools.ant.util.JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.java:301)
	at org.apache.tools.ant.util.FileUtils.<clinit>(FileUtils.java:94)

The failure only happens on Windows because the Ant source code added additional logic for Windows junctions in commit:

This reverts commit d8ce08e from pull request:

This is another case where the subset of tests run on Windows missed a test failure. It is even more surprising that the Windows test selection process did not identify that the failing tests should be run in all pull requests after the initial failure on the master branch. Probably needs further discussion with the predictive test selection experts at CloudBees. @daniel-beck you are not alone.

This is also a case where the acceptance test harness and the plugin BOM did not catch the issue, because they do not run on Windows. This type of platform specific bug happens so infrequently that I don't think it is worth the expense to run those tests on Windows.

Testing done

  • Confirmed that I can duplicate the problem on my Windows computers with the commands:
    mvn -am -pl war,bom -Pquick-build clean install
    mvn -pl test -Dtest=hudson.slaves.JNLPLauncherRealTest test
  • Confirmed that reverting Apache Ant 1.10.16 fixes the issue

I was unable to duplicate the issue from a Windows controller using websocket connected agents from a Windows computer or from two different Linux computers. Likewise I was unable to duplicate the issue from a Windows controller with a Linux agent that connected without using websocket. I suspect there is a user visible bug in Jenkins 2.558 due to this issue, but I was unable to find it.

Screenshots (UI changes only)

Before

After

Proposed changelog entries

  • Fix Windows null pointer exception due to Apache Ant 1.10.16 (regression in 2.558).

Proposed changelog category

/label bug

Proposed upgrade guidelines

N/A

Submitter checklist

  • The issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • UI changes do not introduce regressions when enforcing the current default rules of Content Security Policy Plugin. In particular, new or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@jenkinsci/core-pr-reviewers I'd appreciate a review of this pull request so that the regression is fixed in the next weekly release.

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, be a Bug or Improvement, and either the issue or pull request must be labeled as lts-candidate to be considered.

…6566)"

The Apache Ant 1.10.17 What's New document describes the bug as:

https://github.com/apache/ant/blob/4198028c333ea163ac67e58a0e63f31d0475a214/WHATSNEW#L7

> The JavaEnvUtils and FileUtils classes statically depend on each other
> since Ant 1.10.16 making it impossible to load JavaEnvUtils without
> loading FileUtils first causing NullPointerException for programmatic
> use on Windows. This affected Eclipse and may also affect other projects
> using Ant as a library.

Automated tests on ci.jenkins.io Windows agents have been failing since
3 Apr 2026.  The failures report a stack trace:

Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.tools.ant.util.DeweyDecimal.compareTo(org.apache.tools.ant.util.DeweyDecimal)" because "org.apache.tools.ant.util.JavaEnvUtils.parsedJavaVersion" is null
	at org.apache.tools.ant.util.JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.java:301)
	at org.apache.tools.ant.util.FileUtils.<clinit>(FileUtils.java:94)

The failure seems to only happen on Windows because the Ant source code
added additional logic for Windows junctions in commit:

* apache/ant@45b84bb#diff-fdf66b5ecb8a9eb6a9d4e8bb1bc95ce8fc8872c5664fa7e5d899b3dc31af2891R91

This reverts commit d8ce08e.

Testing done:

* Confirmed that I can duplicate the problem on my Windows computers
  with the commands:

  `mvn -am -pl war,bom -Pquick-build clean install`
  `mvn -pl test -Dtest=hudson.slaves.JNLPLauncherRealTest test`

* Confirmed that reverting this pull request fixes the issue
@MarkEWaite MarkEWaite added regression-fix Pull request that fixes a regression in one of the previous Jenkins releases bug For changelog: Minor bug. Will be listed after features labels Apr 10, 2026
Copilot AI review requested due to automatic review settings April 10, 2026 01:28
@MarkEWaite MarkEWaite added regression-fix Pull request that fixes a regression in one of the previous Jenkins releases bug For changelog: Minor bug. Will be listed after features labels Apr 10, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reverts the Jenkins BOM-managed Apache Ant dependency from 1.10.16 back to 1.10.15 to avoid a Windows-specific NullPointerException regression affecting programmatic Ant usage (observed in Jenkins CI Windows agents).

Changes:

  • Downgrade org.apache.ant:ant from 1.10.16 to 1.10.15 in the BOM to restore Windows test stability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@timja timja merged commit 5bf90b9 into jenkinsci:master Apr 10, 2026
24 checks passed
@MarkEWaite MarkEWaite deleted the fix-windows-test-failures-in-ant-FileUtils branch April 10, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug For changelog: Minor bug. Will be listed after features regression-fix Pull request that fixes a regression in one of the previous Jenkins releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants