diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index 8c7791c133e..2b9e2c54569 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -140,7 +140,7 @@ class ClusterFormationTasks { } else { dependsOn = startTasks.empty ? startDependencies : startTasks.get(0) writeConfigSetup = { Map esConfig -> - String unicastTransportUri = node.config.unicastTransportUri(nodes.get(0), node, project.ant) + String unicastTransportUri = node.config.unicastTransportUri(nodes.get(0), node, project.createAntBuilder()) if (unicastTransportUri == null) { esConfig['discovery.zen.ping.unicast.hosts'] = [] } else { @@ -717,7 +717,7 @@ class ClusterFormationTasks { Collection unicastHosts = new HashSet<>() nodes.forEach { node -> unicastHosts.addAll(node.config.otherUnicastHostAddresses.call()) - String unicastHost = node.config.unicastTransportUri(node, null, project.ant) + String unicastHost = node.config.unicastTransportUri(node, null, project.createAntBuilder()) if (unicastHost != null) { unicastHosts.add(unicastHost) } @@ -913,9 +913,10 @@ class ClusterFormationTasks { outputPrintStream: outputStream, messageOutputLevel: org.apache.tools.ant.Project.MSG_INFO) - project.ant.project.addBuildListener(listener) - Object retVal = command(project.ant) - project.ant.project.removeBuildListener(listener) + AntBuilder ant = project.createAntBuilder() + ant.project.addBuildListener(listener) + Object retVal = command(ant) + ant.project.removeBuildListener(listener) return retVal }