Reputation: 2504
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)
Upvotes: 4
Views: 1951
Reputation: 1846
You might want to check out http://grails.org/plugin/grails-ant.
It does what Burt suggests, plus adds an ant dynamic property to your controller and other artifacts.
Upvotes: 2
Reputation: 75681
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'
}
Upvotes: 8