Gradle 9.9.0 Deprecates Ant Integration Ahead of Removal in Version 10
Gradle 9.9.0 deprecates built-in Ant support, with a full removal planned for version 10, requiring developers to migrate to native Gradle tasks.
Gradle 9.9.0 deprecates the built-in Ant integration, and Gradle 10 will remove it entirely along with Ant classes on the build script classpath. Builds using ant, AntTarget, or org.apache.tools.ant require updates prior to upgrading major versions.
The deprecation targets AntBuilder, AntTarget, AntBuilderAware, Project.getAnt(), Project.ant(Closure), Project.ant(Action), Project.createAntBuilder(), Task.getAnt(), FileCollection.addToAntBuilder(...), FileCollection.AntType, and PatternSet.addToAntBuilder(Object, String).
Ant integration previously supported migrating Ant builds piece by piece, but maintenance costs include shipping Ant in every distribution, placing it in the Gradle API JAR, breaking Configuration Cache compatibility when an Ant build is imported, and tying the public API to Groovy.
For migration, Ant tasks map to native Gradle equivalents: copy to Copy or FileSystemOperations.copy(), delete to Delete, archive tasks to Zip, Jar, and Tar, exec to Exec or ExecOperations.exec(), and java to JavaExec or ExecOperations.javaexec(). Behavior differences require attention: Gradle's Copy runs up-to-date checks instead of skipping newer destinations (use Sync to delete stale files), Exec fails the build on non-zero exit codes by default, and inputs and outputs need explicit declarations.
Ant FilterReader uses can shift to a plain filter { } transformer, or teams can add org.apache.ant:ant:1.10.17 to the build logic classpath in Gradle 10.
