Hi all,

Not strictly a groovy-specific question I believe, but I also believe that if anybody knows the answer to this, they'll be on this list.

I am working on a project that is mixed Java and groovy code. I'm developing in IntelliJ, it's a maven project that is using GMavenPlus (1.5).

When the resulting artifact is run after I have installed it, the groovy scripts should not be on the CLASSPATH of the application; instead they are loaded dynamically (GroovyClassLoader.parseClass()). So, also inside IntelliJ, when running or debugging the full application, I want to exclude the groovy sources (or compiled artifacts) from the CLASSPATH. However, while developing I do want these scripts to be compiled so I can see any errors. Also when running unit tests the scripts will need to be on the classpath.

I'm looking for a way to achieve the following:
- Groovy sources are compiled when building the project
- Groovy artifacts are NOT on the CLASSPATH when running/debugging the application inside IntelliJ
- Groovy artifacts ARE on the CLASSPATH when running unit tests

Does anybody have any idea how to do this?