Setting up Grails and IntelliJ - grails

I thought I'd give Grails and IntelliJ a look. However, I'm struggling at the first hurdle.
When I go to select the "Groovy SDK" I'm choosing my installation directory - in this case, Grails 2.2.0 - but the OK button on the IDE stays grayed-out. If I choose another of my installation directories - Grails 1.3.7 - the OK button is activated but I get an error message saying my groovy installation is broken.
Does anyone know what I'm missing?
I'm using IntelliJ 12 Community Edition and trying to use Grails 2.2.0.
Thanks.

Please checkout this IntelliJ IDEA Features page, and you will see that some web technologies, like Grails, are only supported in the Ultimate Edition. I would recommend upgrading to the Ultimate Edition, since it has excellent Grails support.
As an alternative, use can use a free IDE which has Grails support: STS, GGTS.

Community Edition doesn't support Grails development. Note that it is asking for a Groovy SDK (which is supported), not a Grails SDK.

Related

Ruby on rails plugin - Intellij idea

So, I"m using intellij idea community addition for ruby on rails development. I installed intellij, ruby, etc. on my computer. However, when I try to install the ruby on rails plugin in intellij after clicking on opening the plugin manager and clicking "install intellij plugins" there is no plugin from the list which is called "ruby plugin." I tried several of the plugins from this website :https://plugins.jetbrains.com/plugin/1293?pr=
....selecting the "install from disk" option. None of them worked.
help please.
Ruby development is only supported in IntelliJ IDEA Ultimate, not in the Community Edition.

IntelliJ 13 New Project No Grails option

I'd like to create a new Grails project in IntelliJ 13.
I have IntelliJ 13.
I have Grails.
I do not see a Grails option in the New Project Dialog.
How do I configure IntelliJ 13 so that the New Project Dialog has a Grails option?
When I select Groovy there's an error about a missing library. Grails was installed under my home directory in ~/.grails by GVM.
Please take a look in which edition of IntelliJ you are using.
The Community edition supports Groovy, but don't support Grails;
the Ultimate edition supports Grails and a lot of Frameworks
You are selecting a wrong(java) option , you have to select groovy in left menu bar and then you will be shown grails option.
My IntelliJ New Project Dialog now has a Grails option, though I'm not sure exactly what caused it to appear.
Here are some things that I did:
On the command line, in an already existing Grails project I ran:
grails integrate-with --intellij
Then I opened the project (which involved migrating the legacy version IntelliJ project file that Grails created to IntelliJ 13)
There was a green box in the upper right corner of the project window that complained about the Grails SDK was not being configured. That box disappeared before I could click on the link inside of it to attempt to correct the problem.
I closed the project and re-opened it, in the hope of causing the green box to reappear. It did not. But a red box appeared that complained that the Java SDK was not configured properly.
In the Project Structure Dialog I configured a Java SDK.
I closed the Grails project, then I tried to create a new Grails project. This time there was a Grails option under the Groovy option.
But I think there is still issue because the dialog shows No library selected for Groovy.
Groovy is included as part of Grails, so perhaps I should click the "Create..." button and choose some Groovy installation that is packaged in the Grails installation? But, this seems like something I would expect IntelliJ to configuration automatically when it is linked to the Grails installation.
Did you enable Grails plugin in IDE? Go to File>Settings>Plugin and check the grails option, restart IDE.
Grails is only supported in the Ultimate version of IntelliJ IDEA. It isn't supported in the community edition.
You can try the Ultimate version for free for 30 days before it goes into a mode where you can only work 15 minutes until it has you stop/close whatever you're doing and reopen the IDE, I guess.
I guess you are using the community edition of IntelliJ IDEA, which does not provide any option to create a grails application. But that doesn't mean that you are not allowed to create a grails project.
Use the command line to create a new Grails project,
grails create-app YourAppName
this will create the grails app in your present working directory.
Then simply run the app using the following command
grails run-app
this will resolve all the dependencies, and start your app.
Now open the IntelliJ IDEA and load this app from your present working directory, then proceed as instructed and that's it.
Only demerit of using this technique is that suggestions and auto-completion won't work, GSP pages will be unrecognized. If you want these features then go for Ultimate Edition of the IntelliJ IDEA.
You can create a grails project via terminal (grails create-app ... ) and just import (or new -> from existing sources) project from Idea. Than you should choose "import project from external model -> gradle (or maven)". And your project is ready!
I think this will help you.
You need Ultimate version of IntelliJ not Community one in order to use Groovy/Grails.

IntelliJ 12.0.1 - Grails 2.3.X Distribution in specified path is broken

I am struggling to configure grails 2.3.X in IntelliJ idea 12.0.1. Grails 2.2.X is configured successfully.
Grails 2.3.2 is working properly from terminal. I can compile, test, run my application. But while trying to configure it in IntelliJ so that dependencies get resolved, I get the IntelliJ shouting straight to me(as pictured below).
Looks like Grails Distribution in specified path is broken. Cannot
determinate version.
What I see is changes in grails-2.3.x/dist/ to earlier version's grails-2.2.x/dist/.
Is this because there's no support for newer version(2.3.x) of grails in IntelliJ 12 or what ?
I want nothing else but my application (jar) dependencies to be resolved in the IDE.
Make sure you are running the latest version of IntelliJ IDEA - v12.1.6. There was a "Grails 2.3.0 not working" bug fixed in 12.1.6.
You may also want to take a look at the Grails SDK is not configured question. One of the IntelliJ IDEA developers has a detailed answer in that question that may help.
Also, this thread on the IntelliJ IDEA forum may be useful.
For Information to reload the dependencies in IntelliJ 12.1.6 , following path works fine.
Tools
-> Grails
-> Synchronize Grails settings

Netbeans groovy 1.8 support

I am using NetBeans 7.1, which comes with Groovy 1.6 support. I have to do a Grails project, but with Groovy 1.8 support. So I downloaded Groovy 1.8 installer, installed it and added the Library in Netbeans -> Tools -> Libraries (and removed Groovy 1.6 library).
Now whenever I use some stuff added in Groovy 1.8 within my Grils project, it still underlines it and throws "cannot resolve" error... I was googling it for last 2 hours and everything I find seems I have already done... it starts to give me a headache... Any suggestions on how to solve it?
NetBeans support from Groovy has -- until recently -- stagnated.
The Groovy support (as you say) is for Groovy 1.6.X, and the Grails support is similarly old.
There has very recently been some activity in trying to improve this, but at the current time you are probably better using Eclipse, STS (both free) or IDEA (paid) if you want proper IDE support for up to date Grails development.

SpringSource: Grails plugins

More often when I install a plugin, doesn't recognize it.
For example using Joda Time, I have a variable LocalDateTime date (i'm importing joda library) and eclipse says unable to resolve class LocalDateTime, though the application works.
Or I have installed the grails icepush plugin but after the installation taglib files were missing.
It's a SpringSource problem?
You should upgrade to SpringSource Tool Suite (STS) which is Eclipse bundled with a suite of plugins. It has great support for Groovy and Grails. 2.5.0 was recently released and it has a plugin wizard for installing, updating, and uninstalling plugins, although it supports plugins installed from the commandline too. I find I sometimes need to manually refresh it but that's simple - just right-click on the project and select Grails Tools | Refresh Dependencies.
After installing you'll need to add support for Groovy and Grails - that's available from the Dashboard.
Download from http://www.springsource.com/developer/sts
You are not doing anything wrong, chances are the eclipse toolset is still behind the competition. As mentioned by #Burt, you can get the STS from SpringSource directly or you can get IntelliJ IDEA which also has a very good clean interface to Grails applications. The latest 9.0.3 works very well with large, complex Grails applications, and seems to have a very advanced intellisense (autocomplete) capabilities.

Resources