Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some issue with AntBuilder?

Tags:

grails

groovy

ant

When i am deploying grails application, it's show classnotfound Exception in AntBuilder class?. Do i need to add any jar files to project? Thanks in advance.

java.lang.ClassNotFoundException: org.apache.tools.ant.launch.AntMain
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at org.apache.tools.ant.Project.initProperties(Project.java:308)
    at org.apache.tools.ant.Project.init(Project.java:295)
    at com.cabot.reader.BookController$_closure5.doCall(BookController.groovy:109)
    at com.cabot.reader.BookController$_closure5.doCall(BookController.groovy)
    at java.lang.Thread.run(Unknown Source)
like image 591
Sanal MS Avatar asked Dec 28 '22 19:12

Sanal MS


1 Answers

The Ant jars are available in run-app because they're needed to run the scripts. But the jars aren't included in a war because in general Ant isn't used by the web app. But you can include them by declaring a dependency in grails-app/conf/BuildConfig.groovy:

dependencies {
   compile 'org.apache.ant:ant:1.7.1'
   compile 'org.apache.ant:ant-launcher:1.7.1'
}
like image 82
Burt Beckwith Avatar answered Jan 05 '23 17:01

Burt Beckwith