Grails + Gant + IntelliJ = Not playing nice

Hi Intellij Community

I've written an ant script that compiles our current project and then FTP's it up to our live server.

I'm now redoing it in GANT

But it keeps throwing up the following error :

Cause: the class was not found.

        This looks like one of Ant's optional components.

Action: Check that the appropriate optional JAR exists in


        -the IDE Ant configuration dialogs

I've tried putting these files in my ANT_HOME\libs folder.

The command generated by intellij is as follows :

C:\Programs\java\jdk\bin\java -Dgrails.home=C:\Programs\grails -Dbase.dir=C:\Working\Imagine\Code\PROJECT -Dtools.jar=C:\Programs\java\jdk\lib\tools.jar -Dgroovy.starter.conf=C:\Programs\grails/conf/groovy-starter.conf -Dgrails.project.compile.verbose=true -Xmx512M -Dfile.encoding=UTF-8 -classpath C:\Programs\grails\lib\groovy-all-1.7.8.jar;C:\Programs\grails\dist\grails-bootstrap-1.3.7.jar --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf C:\Programs\grails/conf/groovy-starter.conf copy-to-staging --lib c:\programs

(The problem here is that I'm informing IntelliJ about extra Jar files but it doesn't fetch them, while running the Gant natively does)

When I run the following via GANT it works :

C:\Programs\gant\bin>gant --lib c:\programs


   [delete] Deleting: C:\Users\Corne\AppData\Local\Temp\ant1792513920.tmp

      [ftp] sending files

      [ftp] 0 files sent

------ main


Total time: 10.65 seconds

But as soon as I try run it via IntelliJ and Grails it breaks...

The problem seems to be that by using the "Run Target" command I can't pass in extra parameters.
So for example if I put in "copy-to-staging  -n" in the command line it still executes the tasks even though it is meant to dry run
same goes for "copy-to-staging  -s" which is meant to activate silent mode..

Am I passing these commands in, incorrectly or does Intellij just run the Grails Targets in such a way that parameters are ignored.

Comment actions Permalink


Please check your gant file run configuration (main menu / Run / Edit configurations).

It has Module field. Runtime libraries are taken from that module. You can add necessary jars to its dependencies.


Comment actions Permalink

Hi Alexander, thanks for the reply.

The thing is I don't really want to bundle those jars into my current module, unless I really have too.

My looking for a way to point gant to altenate lib files via command line params (if this is at all possible)

Comment actions Permalink


But what does "bundle" mean? Module dependency is just a reference. The referred jar is not automatically packed, deployed, or so.

Anyway, I've just tried the Script Parameters field:

--lib "C:\Program Files\MySQL\mysql-connector-java-5.1.6" targetName

And it seems to work. Please, try to surround the path with quotes.



Please sign in to leave a comment.