Question

I was trying

Ant.echo("hello gant")

but I am getting this error message:

No such property: Ant for class: build

Any help would be highly appreciated.

Was it helpful?

Solution 2

gant is also having "ant" injected itself

OTHER TIPS

In groovy you first need to create an instance of the AntBuilder class. The following code works:

def ant = new AntBuilder()

ant.echo("Hello world")

Actually in grails ant is avaiale by default.

   ant.echo("hello gant")

You just need to use lower-case "a" in "ant" and run it. This should work fine.

The short answer to this question is just change Ant.echo to ant.echo or just omit "ant." and "echo" directly. It will call the ant.echo.

Another case will often cause this issue is when we define the property. Do not use property name like "ant.lib.path", "xx.xx.xx", it's not working in gant, gant will treat "lib" is the property of "ant" and "path" is property of "lib" , which is not correct, use "antLibPath" form instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top