Post Jenkins Upgrade Issues with Ant Installation

Upgraded to Jenkins 2.492.3 from Jenkins 2.222.x, currently on Java 21 and Oracle Linux Server 8.1, and when building a job setup with Apache Ant the build.xml that is generated by the plugin contains a deprecated flag -Xlint:sunapi that is causing the job to fail. See below:

compile:
[javac] Compiling 748 source files to /var/lib/jenkins/workspace/JIMSServices/build/classes
[javac] error: invalid flag: -Xlint:sunapi
[javac] Usage: javac
[javac] use --help for a list of possible options

Does anyone have any advice on how to fix?

Welcome back, @aadams26. :waving_hand:

I guess you’re using the Ant plugin, right?
Did you update it (and all other plugins too) after updating Jenkins?
The current version is 513.vde9e7b_a_0da_0f.
What is the version of ant that is installed on the agent?

1 Like

Thank you @poddingue!
Yes, that’s the version of Ant that I’m on. I updated all the plugins but some are deprecated. The issue is with the build.xml file it generates that’s where it’s adding the lint flag. Any ideas what the issue could be?

@aadams26

If I understand correctly, we’re discussing the Jenkins Ant plugin version, not the Ant version itself. Could you let me know which version of Ant you have installed on your platform? If you have a very recent version, that might explain the issue.

If that’s the case, could you please try to reproduce it with the simplest example possible and create a new issue?

Thank you!

I have version 1.10.15 installed on my platform.

1 Like