Is it just me or is there anyone else having troub...
# questions
j
Is it just me or is there anyone else having trouble getting IntelliJ IDEA to work OK with Grails 6 (on Windows)? It's not something to do with anything I've done with my app, because it occurs with a complete minimal virgin app downloaded from the Application Forge. 'DependencyResolveDetails' in build.gradle is not recognised and presumably as a result, I get a whole bunch of imports being flagged as having errors. This is IntelliJ IDEA 2024.1.3 (Ultimate Edition), and there's no difference with 2024.1.7 (the latest). I also get a whole load of errors in the Build window, starting with this: Could not resolve all files for configuration 'buildSrcruntimeClasspath'.
Could not resolve com.bertramlabs.pluginsasset pipeline gradle4.3.0.
Required by: project :buildSrc I don't have any such problems with my Grails 5 apps. Oh, and the Grails 6 apps compile and run fine from the command line, so it's obviously an IntelliJ specific thing.
I don't think the import 'errors' are linked with the DependencyResolveDetails now. Something else is involved.
t
I'm not 100% sure this is the issue, but I just checked my Grails 6.2.0 application and we have
runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails:4.3.0")
in the
build.gradle
file. Does yours have
asset-pipeline-gradle
rather than
asset-pipeline-grails
?
j
No, it's the same as yours.
I just uninstalled IntelliJ IDEA 2024.1.3 and installed 2024.2.4 instead and am seeing exactly the same issues. So, new IntelliJ installation, untouched app fresh out of Application Forge. So where could the problem be?
j
6.2.1 will work out of the box. For 6.2.0 you have to add the grails-shell dependency.
j
I have 6.2.1 - that's where the problem is occurring (also in 6.1.2 and 6.2.0).
j
Since it is failing on asset-pipeline, I'd make sure buildSrc/build.gradle looks like the following. Here is a 6.2.1 app from start.grails.org on Windows 11. Also make sure you are using Java 11 or 17.
j
Thanks. I figured that as it was occurring with a pristine installation of IntelliJ and a pristine Grails application downloaded from Application Forge, it must necessarily be caused by something specific to the environment it was running in. In the detail of the error messages, Java 8 and Java 11 were mentioned, so I checked and found that although I thought that IntelliJ was running under Java 11, JAVA_HOME on my Windows laptop was set to Java 8. Having changed this to Java 11, everything now appears to be working fine. I have no idea why this would have been affecting import statements but never mind, I can move on now. (For some reason, DependencyResolveDetails in build.gradle is still unrecognised by IntelliJ, but it doesn't appear to to be affecting anything). I presume the reason Grails 5 apps worked OK is that they worked with both Java 8 and Java 11, whereas Grails 6 requires 11 or later.
LATER... I decided to move everything on to Java 17, as it is possible to use it, and with a view to switching to Grails 7 at some point soon.
🚀 1