0

I am taking over development of a rather large grails project. The development was initially done in STS however I would like to move to IntelliJ Idea.

Initially I thought this would be a piece-of-cake because of the "integrate-with --intellij" command. This is however not the story :(

The project consist of mulitple grails-plugin projects (Please don't ask me why it was developed this way) and some of them with web-descriptors. I start out by migrating one of these, since this is one of the "main" projects (X).

Each of the developed plugins that X has as a dependecy to Intellij creates as "YinplacePlugin" modules where Y is the plugin name. And this is where the fun begins! The "YinplacePlugin" module created for the Y project has of course a lot dependencies it self. These are, if I look in STS, referred to in $USERHOME$/.grails/project/Y/plugins/xxxx and this path is in STS included in the build-path.

But these depencies FAIL in idea. I CAN use the "grails compile" option from within the project however IntelliJ "Make Project" or "Make Module" fails because of missing references. See below:

Failing reference

STS reference

The first image shows the failing reference. The second how STS has this on the build path.

So why don't you just add the libraries to the build path? one might ask. Well, I tried. One result:

IDEA hook: Grails not found!
| Error java.lang.NullPointerException
| Error     at org.jetbrains.groovy.grails.rt.Agent$2.run(Agent.java:99)
| Error     at java.lang.Thread.run(Thread.java:662)

I am out of ideas. Any ideas how to get this to build using "Idea Make Project"? All I want is an IDE without "red-lines" so development will be smooth!

Hoof
  • 1,738
  • 2
  • 17
  • 39
  • Are you able to get the whole set of projects without any IDE, only on command line? I saw similar error after I upgraded project from Grails 1 to 2, not solved yet. – Tom Metz Sep 28 '12 at 07:34
  • You mean if I am able to build the entire project without IDE? Yes! No problem - grails compile works just fine! – Hoof Sep 28 '12 at 07:42
  • I was able to get this error fixed by a configuration in BuildConfig.groovy: grails.project.work.dir = "target" – Tom Metz Sep 28 '12 at 10:00
  • And what does "target" point to? It seems IntelliJ picks up on this configuration, so it might actualyl be the fix! :) – Hoof Oct 01 '12 at 07:01
  • It is the same directory, where the output of the compilator goes. Ususaly it is directory "target", but you can redefine it in IDEA's settings. – Tom Metz Oct 01 '12 at 07:25
  • Hm.. sadly that doesn't do the trick for me :( – Hoof Oct 01 '12 at 07:38
  • That's bad :-( I was trying to continue to upgrade my project and I am also stuck in "red code" now. In this moment no clue, how to fixt it :-( Maybe I'll create completely new project and try to copy the existing code there, if it starts to work. I was also thinking, that maybe IDEA copies some silly settings from the Eclipse project files ... – Tom Metz Oct 01 '12 at 07:47
  • I found this, stating you basically have to do the most work manually: http://www.jayway.com/2009/09/06/setting-up-grails-projects-in-intellij-idea/ however, I haven't tried if it fixes the issue.. – Hoof Oct 01 '12 at 10:50

0 Answers0