3
votes

I'm trying to Gradle-ize our build by using Gradle to execute the Ant build. I'm using the java plugin so I can set source/target and I'm using ant.importBuild 'build.xml'. When I execute Gradle, I get the error above. I understand that both Ant and Gradle have these targets/tasks in common: clean, jar, javadoc, test. One option is to change the Ant target names in build.xml, but I'm hoping there's an easier way as I have a lot of projects and build files. I found this "wrapper" solution (http://issues.gradle.org/browse/GRADLE-771), but this did not work for me. How can I solve this?

2

2 Answers

4
votes

Your options are:

  • Do not apply the plugin to the same project that imports the Ant build.
  • Rename the conflicting targets in the Ant build script.
1
votes

You can rename all the ant targets:

ant.importBuild('build.xml') { String oldTargetName ->
    return 'ant_' + oldTargetName
}