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)
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'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With