Grails 3.0 support in NetBeans - grails

I was running Grails 2.2.0 in NetBeans and it was working fine. I tried to upgrade the project to Grails 3.0 but after creating the project NetBeans is not able to open the project.
Does anyone know which plugins to install in NetBeans (if available) to make Grails 3.0 work?

Just wanted to let you know that I've added initial support for grails 3 in NetBeans.
https://netbeans.org/bugzilla/show_bug.cgi?id=254405
At the moment you can get these with the latest NetBeans nightly: http://bits.netbeans.org/download/trunk/nightly/latest/
This will allow NetBeans to recognise/create projects, and the create controller/domain/etc actions working.
One important thing still missing is adding support for the gradle build files (no syntax highlighting or helpers for the gradle files), but in the meantime you may try it and report problems/improvements.

Related

Error creating Grails project in NetBeans

The error I have is the following:
Warning |
Unrecognized flag: non-interactive.
Resolving dependencies..
Error |
Specify an application name or use --inplace to create an application in the current directory
I'm following the steps that come on the NetBeans page.
I have installed:
Grails 3.3.8.
Groovy 2.4.15.
NetBeans 8.2.
From console create a project using grails create-app hello world and in this case it seems that there were no problems.
NetBeans doesn't currently support Grails 3.x as far as I know, however you might be able to import it as a Gradle project. I know that Netbeans is working on updating there Groovy support soon, maybe that will help...
The best IDE for Grails is Intellij Ultimate, which costs money, however you can use the community version, you just won't get GSP support.

Grails Project not shown in NetBeans project window

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.

Grails GGTS "Task 'assemble' not found in root project" error when running "grails war" in Command Prompt

I have been learning Groovy/Grails Tool Suite (GGTS) 3.6.4, with Grails 2.4.4 using some video tutorials. When I attempt to package the project into an application using the grails war command on the Windows command prompt, I get the following error:
"Error Gradle build terminated with error: Task 'assemble' not found in root project ..."
Any references to this error that I have found online have only involved Android Studio (for instance), so I am at a loss here as to how to fix it for GGTS.
I have Android Studio 1.0.1 installed, and in case it was affecting the Grails packaging, I tried the solution of removing the <component name="FacetManager"> from the general Android Studio "MyApplication.iml" file, but that had no effect. I couldn't find any analogous file for the GGTS.
In case the issue lies elsewhere in my overall installation, I have Java JRE 7_79 (64-bit) installed, as well as the the JDK 1.7.0_79 (64-bit)
OK. I found out what the cause of the error was, and how to avoid it in the future.
The Problem
Grails 3.0.1 requires the following files for grails war to work:
build.gradle
gradle.properties
gradlew
gradlew.bat
\gradle (directory)
Grails 2.4.4 does not require any of the above files for making a WAR file.
GGTS 3.6.4 does not work with Grails 3.0.1, but it comes with and works fine with Grails 2.4.4.
The Solution
Copying the stated Gradle files & directory to a GGTS project folder fixed the problem. However, I wasn't satisfied with needing to do this manually or with a custom batch file for every project.
Looking deeper, it turns out that when working out compatibility issues between the Java 32-bit JRE existing on my system and the Java 64-bit JRE & SDK, Grails, and GGTS versions (there was a lot of fiddling to get things working), at one point I had set up my global variable to Grails to be directed at 3.0.1, and I failed to update it to Grails 2.4.4. Making this change has fixed the issue.
Explaining the Cause
When following this video series on installing a compatible set of Java, Grails, and GGTS, the instructor manually downloaded the latest version of Grails from the Grails site and then downloaded GGTS separately from its own site. Both of these were older versions than what I was working with.
In my case it turns out that, after setting up the Java SDK & Grails, the latest version of GGTS (3.6.4) did not work properly with the latest version of Grails (3.0.1). Fortunately the GGTS bundle came with an older version of Grails (2.4.4), and by referencing that, GGTS would work correctly. However, although I changed the IDE reference to Grails, I forgot to reset my environment variable ...
So GGTS was setting up the project for using Grails 2.4.4. However, when calling grails war, the command was using Grails 3.0.1! Apparently these two versions of Grails use different files for creating a WAR file, so GGTS was not setting up the project directories with the correct local files, and the packaging was failing.
Avoiding Future Occurrences
So, when using GGTS 3.6.4, make sure that all references to Grails point to Grails 2.4.4.
In general, if any GGTS bundle contains a version of Grails, you should have everything set up to use that version, even if it is old.

Errors when upgrading a Grails Project Groovy\Grails Tool Suite

I'm trying to run a Grails Application from the Grails In Action website. I've imported the 'hubbub' project into the GGTS app and have encountered build errors. The project was originally built with Grails 2.3.7 whereas I have version 2.4.4 on my system. Based on another Stack Overflow question I've changed the 'app.grails.version' in the application.properties file to grails version 2.4.4 which prompted a flurry of downloads in the command prompt terminating in a series of errors regarding problems with plugins. I can't run the app because I'm told that "Project 'hubbub' is missing required source folder: grails-app/utils". If I try to change 'app.grails.version' back to 2.3.7 I'm told that I need to configure a Grails installation of 2.3.7.
Am I doing something wrong here in trying to upgrade this Grails project? Or do I really have to install Grails 2.3.7 in order to get this to work?
(Sorry, I haven't posted the errors regarding plugin downloads but I can't seem to recreate them).
Thanks in advance!
Grails 2.4 is a big change over 2.3, mostly due to the use of the asset pipeline instead of resources.
Also simply changing the version in application.properties isn't enough, you also need to actually run the matching Grails framework.
See here for upgrading an app from 2.3 to 2.4: http://grails.github.io/grails-doc/2.4.x/guide/upgradingFrom23.html . From experience upgrading Grails apps from older versions must be done manually. One reason is that the upgrade command is obsolete and has been removed. Read the docs for breaking changes and address each change individually in the code. Upgrading patch levels are no problem (usually), but upgrading minor and major versions often are a lot of work.
Since you are learning, I would stick to 2.3.7 for your exercise (meaning that you must run 2.3.7, which you aren't doing). What you'll learn will remain valid. Do use 2.4.4 when building your own project from scratch.
If your project only missing grails-app/utils, try just to create it.
Take a look in your Project Properties -> Build Path. There are all the source folder defined. It can be helpful

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

Resources