I have a grails 2.0 app which I have installed the resources plugin into, when I look at the list of installed plugins in intellij it doesnt have it ticked, however if I do a 'grails list-plugins' it shows as being installed. Is there any way to refresh or correct the list in intellij? Other plugins have installed fine, and I have tried reloading the list in intellij.
IDEA looks into %USER_HOME%/.grails/2.0.0/projects/%PROJECT_NAME%/plugins to determinate which plugins are installed. Make sure that that folder contains unpacked 'resource' plugin.
If that folder contains unpacked plugin right click on grails project then select Grails -> "Synchronize Grails Settings" in the context menu.
Going to File -> Invalidate Caches fixes this problem, the lists now match (note: this does delete your local history also)
Related
My Intellij IDEA 13.1.4 Ultimate isn't creating new Grails projects using "File" > "New Project".
I mark my project as Groovy Project then I select Grails. I setup a Groovy Library pointing to my Grails 2.4.3 home (I've tried with 2.3.11 and 2.2.5). I click Next and put a name for my project.
Then, when I finish this process, the Intellij Window opens but the Grails "create-app" script doesn't runs and the project isn't properly configured. The folders like "grails-app" and "web-app" aren't created. No log error or warn was generated.
Importing an project works well.
Instead of choosing grails in the menu choose groovy and then select the grails library like this:
that will somehow trigger the create-app script
this is a bug in IDEA, see IDEA-127693
I've been unable to create/import a Grails 2.4.3 project with IntelliJ 13.1.4. For example, when I create a new module, choose Grails, then click the create button (highlighted below) and choose the location where Grails 2.4.3 is installed, the project is not created correctly (I get a module with just a /src directory instead of a Grails project) and Grails 2.4.3 is not added to the list of Global Libraries. I don't have this problem with any earlier version of Grails.
I have used Grails 2.4.2 with Intellij 13.1.4 successfully. What I did is create the application with the grails create-app command and then do a File / Import Project in Intellij. Give that a try.
As an alternative solution to the IntelliJ 13.1.4 and Grails 2.4.3 bug you can:
grails create app <app-name>
cd app-name
grails integrate-with --intellij
This configured the project correctly for me with just minor tweaks to SDK and application server. This is a minor twist on the work around described above.
See grails doc here
I had the same problem with IntelliJ 13.1.4 and Grails 2.4.3, which i just downloaded.
After using the grails create-app command from the command line i had to import the project, by "create from existing sources" (point to the new top level folder), "Configure SDK" (to set for the Grails 2.4.3) and finally edit the run configuration. In a second test run with a new test project i did not have too configure the run config.
Then the Grails libs for the were downloaded and the basic app ran. Also the Grails specific option in the Intellij "Tools2 section were suddenly available.
So the given answer by Joe is the way to setup a new Grails project but the IDE should be fixed anyways.
It is not consistent. After several tries I can get some applications to work but it does not seem to be automatic. I think I am going to go back to Grails 2.4.2 until this is resolved within Intellij 13.1.4.
In the screenshot above, there are options for groovy/grails/griffon, and so far the alternative offered was command-line. Try choosing groovy option within intelliJ.
We are using IDEA 13.1.4 with grails 1.3.7 and grails 2.2.1(diff projects) and saw the same issue. It appears this is an intelliJ issue and not so much the grails version, so reverting your grails won't gain you anything. Choosing groovy, you should see a prompt for grails directory structure. This does work if you are presented with this option. Seeing inconsistencies here. Thanks to all for posting your workarounds; never hurts to have multiple approaches.
-Duane
I am trying to update an older 1.3 Grails project to the latest Grails/Groovy/etc. So I downloaded Grails 2.4.2, Groovy 2.3, and Java 1.7.0_65. Then I imported the project via Import->Grails. I found out that plugins are now configured via the BuildConfig.groovy file, so I edited that with the plugins section and ran Grails Tools -> Update Dependencies. None of my plugins appear on the classpath? However, if I startup the plugin manager (which I'm not fully clear on why it is in the product as it states it won't do much after version 2.3...), it does list:
Plug-ins you currently have installed are listed below:
-------------------------------------------------------------
mail 1.0.6 -- Provides Mail support to a
running Grails application
routing 1.2.0 -- Routing capabilities using
Apache Camel
routing-jms 1.2.0 -- JMS integration for the
grails-routing plugin
shiro 1.2.1 -- Apache Shiro Integration for Grails
So SOME part of Grails seems to know about the plugins. Also, if I delete the plugins from my $HOME/.grails/projects/myProject/plugins directory and re-run the Grails Tools -> refresh dependencies, I get both text on the console saying they are being installed and they come back to that directory.
The ONLY thing that seems abnormal, is that during the second set of files compiled (my project files) there ARE compile errors. I expected these (for instances of grailsApplication / etc). To fix them, I wanted to use GGTS - however, there are SO many compile errors in there from the plugins not being on the classpath it is not very feasible.
If anyone has ideas or suggestions for me to try that would be greatly appreciated!
I think it's a problem with GGTS not knowing what your grails work directory is.
You can check you .project file to see if the .link_to_grails_plugins resource is defined correctly.
GGTS may have created the .project like this
<linkedResources>
<link>
<name>.link_to_grails_plugins</name>
<type>2</type>
<locationURI>GRAILS_ROOT/projects/myProject/plugins</locationURI>
</link>
</linkedResources>
GRAILS_ROOT is a variable defined in your GGTS Preferences under General -> Workspace -> Linked Resources
You might have to add the variable if it's not there.
Set the value to the absolute path for $HOME/.grails and then try to refresh your dependencies.
I installed Spring Security Core plugin for my Grails project and it works just fine. The problem is that I can't locate the actual plugin files. I can't find any of my projects inside .grails/2.4.2/projects where according to my understanding Grails is suppose to store all the plugins. The directors exists but there are no projects in this folder.If I want to edit grails.plugin.springsecurity.LoginController where do I go to find this controller? I am on OS X 10.9.3
By default the plugins are in .grails/<version>/<project>/plugins. You can change it by setting grails.project.plugins.dir (setting it to 'plugins' will create a plugins folder in your project source directory) in BuildConfig.groovy.
then copy the LoginController to your own source tree (to the same location) to override and edit the plugin version.
Just in case someone else runs into this.
In 2.4.4 you would put the theme into
/<project>/target/work/plugins/jquery-ui-<version>/web-app/jquery-ui/themes/<themename>/
Is there any way to get IDEA to automatically download sources for Grails, my plugins and all the dependencies? Alternately, is there an easy way to get IDEA to pickup sources downloaded by this plugin?
http://www.grails.org/plugin/eclipse-scripts
It puts them under ~/.ivy2/...
IDEA should automatically load all plugins for a Grails project, if the Grails/Griffon plugin is being used.
I see all the Grails plugins for a given project in my Grails View, under Plugins.
If you aren't seeing the files, try right-clicking on the project's name in the Grails View, and choosing Grails > Synchronize Grails settings.
Please note that if you are using the free (community) version of IntelliJ IDEA, it does not include the necessary plugins for working with Grails directly. You must pay for the full version to get it.