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.
Related
I have created a Grails and Gradle project in Intellij (following the instructions here: https://www.jetbrains.com/idea/help/creating-gradle-project-with-grails-integration.html).
However, after I generate the Grails project (using the init gradle task), the Grails View does not appear as in step 5 in those instructions.
I can't find any way to make Intellij recognise it as a Grails project. When I do 'Add Framework Support' there is no grails option. When I right click on the project there is no 'Grails' option. So I can't run Grails commands or do actions such as create a new controller.
I am using Intellij 13.1.3, Grails 2.5.0, Gradle 2.8 and Grails Gradle Plugin 2.2.0.RC1. I have tried a number of different versions of each of these with no success.
Does anyone have this working or know how to get Intellij to recognise a Grails project with Gradle?
Typical - after several days trying I found the answer 5 minutes after posting... This was not supported in Intellij 13. I have now tried in Intellij 14.1.5 and the Grails View appears straight away! So the answer is to upgrade Intellij to v14.
Links:
https://github.com/grails/grails-gradle-plugin/issues/66
https://youtrack.jetbrains.com/issue/IDEA-120860
https://youtrack.jetbrains.com/issue/IDEA-116815
I create a new Grails project from NetBeans but when I complete the project complition wizard, nothing to show in my NetBeans project window. My details configuration is:
NetBeans 8.0.2, JDK 8 64bit, Grails 3.0.1
I check my environment veriable setting for Java & Grails also. Everything seems ok, and one important thing is in command line when I type grails -version, it shows the version name and so on. I uninstall NetBeans, JDK, & Grails several times but same problem, I also try it for JDK 1.7 32 bit, no result. I'm used to with NetBeans, so I don't try to other IDE.
Maybe look where the project is defined on disk and open it into NetBeans.
I dont know how this case was solved, but to me it looks like the problem is still valid:
The New Project wizard (Groovy -> Grails Application) calls "grails create-app" but does not generate the nbproject directory.
My environment is:
NetBeans: 8.0.2; Grails Version: 3.0.4; Groovy Version: 2.4.4; JVM Version: 1.7.0_79
Netbeans 8.0.* does not have support for Grails 3.* projects. It can create project but cannot recognize and open the project since the project structure has been dramatically changed from Grails 2.* to 3.*. There was a task created to resolve this problem. Now it reads VERIFIED FIXED for version 8.1. So please upgrade to Netbeans 8.1.* in order to be able to handle Grails 3.* projects in Netbeans.
I have been developing Grails apps for the past five years or so, and I have yet to find a simple consistent procedure for upgrading a project between Grails versions. Typically, I wind up starting the project from scratch, painstakingly copying code from the old project into a new project, bit by bit. Tweaking along the way to get the tests to pass.
There just seems to be too many balls to juggle, from Grails versions, to groovy versions, to STS/GGTS versions. They all seem to be backwardly incompatible.
I actually work with Grails for a few years too and never had to that this way.
What I do is:
Install the new version of Grails. I use GVM for that and I highly recommend it, but it depends on your platform of choice.
Read release notes for this version and apply them. It's very important step. It often includes some Grails "built-in" plugins upgrades and so on.
Bump up the version number using grails set-version.
Update IDE settings. I use IntelliJ and it runs smoothly most of the time.
Do grails clean/grails clean-all. Remove target.
Run all tests.
Do some "smoke tests" of the application. Test the most important happy paths.
I'm afraid you might already be doing it right, but if you don't own a copy of "Programming Grails" by Burt Beckwith I suggest you buy it. There's a chapter on "Upgrading Applications and Plugins" that might help you tune your approach.
You can upgrade grails version with 5 steps
Project -> Clean
application.properties -> Change app.grails.version = (New version)
Your project -> Properties -> Grails -> Change grails installation to new grails version.
Your project -> Grails tools -> Refresh Dependencies
Run your project
I think this may be help you
If I use GGTS I do the following:
Just in case install latest Groovy compiler (2.3.x) from the STS/GGTS update site (pick Groovy Eclipse). Then select the select.
Go to Preferences Groovy -> Grails and add newer version Grails runtime. Browse to it and then once added check-mark it.
Right-click on the Grails project you'd like to upgrade. Context menu pops up. Click on Grails Tools -> Grails Command Wizard...
Select the "upgrade" command from the list and click Finish. Follow the prompts in the Console view to upgrade the project.
Now set the appropriate for the version of Grails Groovy Compiler version via the preferences Groovy -> Compiler and restart Eclipse
Fix the compiler version for the Grails project if necessary after the restart.
I have recently upgraded my IntelliJ 10 to the latest 11.0.1 version. I am writing grails app and until I was using the older version of IntelliJ everything was fine, however 11 doesn't allow me to successfully add Grails SDK (2.0.0) - I was trying to add the framework support, this however doesn't seem to be persisted (after adding Groovy and then choosing Grails - nothing happens). I have tried to follow those steps as well: IntelliJ IDEA 9.0 - unable to select project SDK for Grails application
I would be grateful if someone would be able to point me how to configure Grails SDK - or what could be wrong in my configuration.
Thanks,
This is exactly the way that I have my global library defined and still I was having exactly the same issue.
I followed OverZealous advice and created a new Grails project named exactly the same as the original one and boom everything is fine now! Thanks for help.
You don't need both Groovy and Grails for Grails project, just use Grails SDK. When creating a new Grails project there is an option to add new SDK, select the home path of your Grails installation and it will be configured automatically as a Global Library and this library will be added as a dependency to your module.
Grails library configuration contains all the jars from GRAILS_HOME\dist and GRAILS_HOME\lib, plus all the jars from the src directory.
In other words, it's not configured as a framework, it's just a library with all the jars from Grails distribution added to the module dependencies.
Each time I restart IntelliJ, version 13.1.2, it loses the SDK configuration. If I right-click on the project and "Add Framework Support" I can choose the SDK that is already configured and it will begin functioning properly. When it loses this setting, it won't allow me to compile or launch the app with grails. I reject the ideas to recreate the project, (been there/done that) as I have many dependent modules I have to verify and I lose all my run configurations that I've setup manually.
I'm posting the "Add framework support" step here so it might help someone else; hopefully a more permanent solution for you, but its temporary in my situation
When I create a Grails application in IntelliJ 9 on Snow Leopard I am not prompted to create an application. IntelliJ finished the wizard and creates an empty project that is not a Grails application. I have tried two different Apple computers (MacBook Pro and Mac Pro) it does not work on either. The same steps on a Linux system results in a prompt to "create-app" and a Grails application.
I have already tried the steps in Intellij IDEA setup on OS X
Is there a specific place that Grails needs to be installed? Has anyone else seen this behavior?
Thanks
Answer: Make sure that the grails directory is writable.
Just tried this on Snow Leopard running Intellij 94.633 (EAP) + grails 1.2.1 and the create new project wizard has worked just fine.
Started with 'create new project', selected a grails module, was then prompted to 'create-app' or 'create-plugin' and was presented with a completed project.
Might be an idea to try the same EAP build if no joy you will have to file a bug with jetbrains. They are pretty good at responding to issues, you should get some sort of feed back pretty soon.
This is actually the first time I've actually done that in intellji, previously I've always just used the grails command line and then just imported the application to Intellij.
Make sure that the grails directory is writable.
I moved my grails install from /opt/grails-1.2.1 to /Users/dave/grails-1.2.1 and I can now create or import grails applications.