문제

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.

도움이 되었습니까?

해결책 2

gant is also having "ant" injected itself

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top