Some issues/questions with IDEA 15, gradle and groovy

Hi folks,

I run a projekt in IDEA 15 with a gradle build script and have configured it to use the output files with

    module {
        inheritOutputDirs = true // should be used by intelliJ
outputDir = file("$buildDir/classes/main/")
        testOutputDir = file("$buildDir/classes/test")

(from the diff, removed lines)
-    <output url="file://$MODULE_DIR$/build/classes/main" />
-    <output-test url="file://$MODULE_DIR$/build/classes/test" />
... and in the project settings the output path changes to "inherit project output path"
But then when I do a Build/Rebuild Project the following message shows:

Specify the output path in Configure Project."

Question 1: Isn't the point of this setting that the pathes from the build.gradle file should be used? Am I doing it the wrong way?

I want to synchronize the output settings, because gradle and idea seem to put my resources files, e.g. persistence.xml, into different directories and so my application refuses to start after I do a build with both gradle and idea. Also Hotswapping does the compile with idea and its settings (correct me if I am wrong), so I want to use the same compiler and output-settings here as in the gradle build.
Which brings me to my next question: I compile both java and groovy code with the Groovy-Eclipse Compiler and have configured both the idea "Java-Compiler" setting and the gradle build file to do so. In the idea configuration dialog the "Path to groovy-eclipse-batch.jar:" configuration must be set. I have set the value to ~\.gradle\caches\modules-2\files-2.1\org.codehaus.groovy\groovy-eclipse-batch\2.4.3-01\484fd2cf2683352175a5511a7b7988a87542602d\groovy-eclipse-batch-2.4.3-01.jar which is clumsy and I can never be sure to use the same compiler an in the gradle config. The version I use in gradle is managed by spring-boot, so I generally don't even care which version number is the right one.

Question 2: Is there a way to synchronize the groovy-eclipse-batch.jar to the one used in the gradle config? If not, how do you guys do it?

By comparinig the .class files produced by the gradle and the idea-build I realized that there are small differences, e.g. in the way switch-cases are implemented, so it seems the compiler used is not the same. Btw, the diff tool is really great, especially the built-in decompiler. One small improvement for .class-files however would be a mode "ignore changes that don't reflect after decompiling", because "different" .class files have no differences shown in the decompiled output.

Thanks for your help!


changed typo by Kurt Seebauer

Please sign in to leave a comment.