Linking src/groovy dependencies between Grails Modules

I created a project and Grails module ( NEW_MODULE ) in Intellij IDEA 12.0.2.

I then linked an existing Grails module ( LIB_MODULE ) to the new project.

In the Module Settings -> Modules -> Dependencies of NEW_MODULE I added the LIB_MODULE module.

In the code browser everything resolves fine.

But when I run the "grails compile" statement I get errors of "unable to resolve

It looks like it resolves LIB_MODULE/src/java classes fine, but cannot find LIB_MODULE/src/groovy.

I'm not sure that it's passing the imported module's classpath when calling "grails" targets.

I'm still trying to get used to dependency/buildpath link of modules in Intellij when I try and recreate what I do in Eclipse with projects.

Am I doing this incorrectly or can this not be done?

Thanks for you help.

Comment actions Permalink

Grails can't know about dependencies between modules configured in IDEA. Are you sure that LIB_MODULE/src/java resolves fine?
May be you have to use LIB_MODULE as grails plugin.

Comment actions Permalink

Yeah, that's what I was trying to avoid. It would be nice to be able to edit the LIB_MODULE on the fly without having to compile and install in the NEW_MODULE on each change.

We're trying to maintain a repository of reusable code across projects, dozens.

In Java projects before we could link src and edit both at the same time but I guess there's no way to pass folders to the ant.groovyc at this time for grails compile.

Once the code in LIB_MODULE is stable it won't be updated as much and we don't mind exporting as plugin or just a jar for inclusion in new modules but it's kind of a hindrance to initial development.

The only reason LIB_MODULE is a Grails module is that's what you get when you choose Groovy module in Intellij, code really only exists in src/java and src/groovy.

If anybody has some similary workflows and found a solution I would love to hear about it.




Please sign in to leave a comment.