I have installed GGTS 3.6.4 and also Groovy & Grails using GVM on my MAC OS.
In GGTS, Preferences - Configure Grails Installation - Add, I want to add the latest grails installed by GVM in /Users/user/.gvm/grails/current
I have also enabled the hidden folders in Mac.
grails version 3.x.x doesn't contain build.properties file.
So, you should follow the following steps:
Create /grails-3.x.x/build.properties file.
Inside build.properties write the content version name as
grails.version=3.1.1
Now, open GGTS .
Go to Window/Preferences.
Type grails in the 'type filter text'.
Select Grails.
Now click on Add button on the right panel to add grails version 3.x.x .
Select the grails version from the My computer.
You are ready to go.
Your GGTS will recognize it as now Grails installation.
According to the GGTS website, it only supports Grails 1.3/2.x (not the latest Grails 3.x). Pivotal discontinued support for GGTS earlier this year.
The best IDE alternative currently is IntelliJ IDEA. Grails 3 is built on Gradle, so no special support for Grails is necessary as IDEA already has excellent support for Gradle projects.
Related
How do I set up Grails with IntelliJ IDEA? I have the ultimate edition. sdkman installed Grails in /home/user/.sdkman/candidates/grails/current/bin/grails
but if I choose that folder as the SDK, IDEA says: The selected directory is not a valid home for Grails SDK
How do I set up an IDEA project with Grails?
grails -version from the terminal provides me the following:
| Grails Version: 3.2.8
| Groovy Version: 2.4.10
| JVM Version: 1.8.0_121
So it's definitely there..
There is no need to select a grails SDK with your version. Import a project from existing sources -> double click the build.gradle file - it will import and setup everything correctly - Assuming IntelliJ 2016.x or 2017.x
Video of process here: http://guides.grails.org/grails-quickcasts-developing-grails-3-applications-with-intellij-idea/guide/index.html
Edit: I see what your saying now, you can't select current in sdkman - use /home/user/.sdkman/candidates/grails/3.2.8
The question was for Grails installed with sdkman, but in case anybody comes looking in here and they have installed Grails with brew, you can brew info grails and find something like this in the output:
The GRAILS_HOME directory is:
/usr/local/opt/grails/libexec
This path will work in the IntelliJ new-project dialog to set up the SDK.
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 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.
I am using
http://spring.io/tools/ggts
for grails development. But the version that comes with this eclipse bundle is above 2.2.0. I need to change the grails version and point it to 2.2.0. I have downloaded grails version 2.2.0. How can i change the grails in the eclipse so that it points to 2.2.0? Thanks for help!
You can configure as many versions of Grails as you like inside of GGTS. Open the preferences and navigate to Groovy -> Grails. Click the "Add" button to add new versions of Grails. Now when you create projects you can select which of the installed versions you want to use. You can also associate different versions of Grails with already existing projects.
I hope that helps.
In Spring Tool Suite 3.5.1.Release , how do I set a project-specific Grails version?
I have multiple versions of Grails configured in STS.
Older versions of STS had a section called Grails in the "Properties for project" window where a particular version of Grails could be selected.
After upgrading to 3.5.1.Release I no longer see this option.
Thanks!
Since GGTS version 3.5.0 the Grails version GGTS uses now always follows the application.properties file in your project. So just change the grails version number in that file.
You may need to do some other things to actually upgrade your project to work with that newer version of Grails of course.
Please go through following step for customize your grails version in GGTS.
1) Go to Window toolbar.
2) Select Preferences.
3) Type grails on textbox and Search
you can see grails installations: where you can add and remove your different grails version. if you need to add grails version please add path of your grails version and select check box for that grails version. after adding and removing grails version you must click on OK button