How to change ant version?


i’m using gradle 1.6 wrapper. I’m successfully building a 3rd software project with it. But now, the 3rd software project have to use ant-1.9.1. Facing up i hope it’s just a joke that there’s no easy way to change ant version within gradle?

I could change the and import ant-1.9.1 in lib, but this results in problems with the original concept of wrapper.

I could change all ant calls in my build.gradle with sshexec blablabla, it’s a joke too

So how to change the ant version the easy way?

Regards Harald Hartmann

The main use of Ant in Gradle is to invoke some Ant task for which no Gradle equivalent exists. For that purpose, the Ant version that Gradle ships with (usually the latest version) works just fine. Since Gradle’s Ant support integrates deeply with Ant APIs, it can’t be switched to a different Ant version. If you do need to use a different Ant version, you can either call out to Ant, or write a plugin that makes programmatic use of Ant. For the latter, your plugin might have to create its own child-first (Ant) class loader.

Hi Peter,

thanks for your answer.

In the meantime i replaced ant(-)-1.8.4 with ant(-)-1.9.1 in lib and lib/plugins, changed the properties in several gradle--1.6.jar(s). At the moment it works fine for me and i hope i won’t have any sideaffects cause ant(-)-1.8.4 is so deeply integrated.

“own child-first (Ant) class loader”? sounds more complicated to me.

“call out to Ant” yes in deed, i will do so in future, replace all ant.* to something like execute(ant…)

Regards Harald Hartmann

Upcoming Gradle 1.8 ships with Ant 1.9.2. Which is it so important to you to be in control of the Ant version?

Cause i’m using gradle as a wrapper around the ant of the 3rd software project, which one can change its ant version every time and checks if you have the right ant version calling the build.xml The last version of the 3rd software project matches the ant version from gradle-1.6 … by fluke as i now carried out :smiley:

Hey Guys,

I am having the same issue. I have third party software that enforces Ant 1.9.1 only. Nothing else, so I cant use gradle wraper easily now. Is there way to solve this?

Thank you so much,

BTW: I love gradle after using it for just couple days, awesome job!