What if you want to develop Grails 2 projects with Eclipse Neon (4.6) as easy as you did with Groovy/Grails Tool Suite? Written and tested with Eclipse Neon and Grails 2.3, 2.4 and 2.5.
Disclaimer: this post is a complete copy of my awesome colleague Ted Vinke’s post about eclipse Mars of last year!
Actually, this is of course only partly true. This post is targeted towards Grails 2 and provides pointers on how to create a minimal install of Eclipse, which is great since code is a liability: more code means more bugs!
The Eclipse landscape for Grails development is a bit shady. Yes, the Getting Set Up in an IDE documentation of the currently latest version refers to Groovy/Grails Tool Suite as the recommended IDE for Eclipse users. However the latest GGTS to be downloaded from https://spring.io/tools/ggts is groovy-grails-tool-suite-3.6.4.RELEASE-e4.4.2-win32-x86_64.zip
which is based on Eclipse Luna SR1 (4.4.2) — not Eclipse Neon.
The Grails IDE plugin — which is the core component for grails 2 — hasn’t been updated since Grails 3 came along and Pivotal dropped support. Luckily for us, it still ‘Just Works!’.
Although Eclipse is not perfect, it is a really powerful tool if you know how to change it to your needs. It is flexible enough to support many languages, tools and workflows. This flexibility comes at a price, in the shape of many plugins that have interdependencies. All these dependencies create many opportunities to have bugs that cause failure. You don’t want that. Use fewer plugins.
A minimal install
In order to have as little bugs as possible, you may want to eliminate all plugins that you don’t need. Here’s one way to get there.
- Make sure that a Java 8 (from oracle for instance) jdk (not jre) is the default version of Java for your machine
- Download the Java package of eclipse:
http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/neonr
- Extract to your favorite location
- Start Eclipse
- Go to Help → Installation details
-
Uninstall the following items (unless you actually enjoy using mylyn, or also use maven?):
Code Recommenders Mylyn Integration
Eclipse Git Team Provider - Task focused
interface
m2e - slf4j over logback logging (Optional)
Mylyn Builds Connector: Hudson/Jenkins
Mylyn Context Connector: Eclipse IDE
Mylyn Context Connector: Java Development
Mylyn Task List
Mylyn Task-Focused Interface
Mylyn Tasks Connector: Bugzilla
Mylyn Versions Connector: Git
Mylyn WikiText
- Confirm restarting Eclipse
Installing what you need
Adding stuff is easy using the marketplace, but could go a lot quicker (if you know what you need).
- Download the following update archive to a fixed location and remember the location: http://download.springsource.com/release/TOOLS/update/3.6.4.RELEASE/e4.5/springsource-tool-suite-3.6.4.RELEASE-e4.5-updatesite.zip
- Go to Help → Install new Software
- Add a new update site, use:
http://dist.springsource.org/snapshot/GRECLIPSE/e4.6/
-
From that update site, install:
Groovy Compiler
2.1
Feature
Groovy Compiler
2.2
Feature
Groovy Compiler
2.3
Feature
Groovy Compiler
2.4
Feature
Groovy-Eclipse Feature
JDT Core patch
for
Groovy-Eclipse plugin on Eclipse
4.6
-
Confirm restarting Eclipse
-
- Add a new update site, use ‘Archive’ to point to the archive downloaded earlier (give it a name for you to recognize)
- From that update site, install only the following:
Core / Grails IDE for Eclipse
→Grails IDE
- Confirm restarting eclipse
- From that update site, install only the following:
- For easy searching, add a new update site, use:
http://dist.springsource.com/release/TOOLS/update/e4.6/
-
From that update site, install:
Eclipse Quicksearch
-
- Ok, we’re done.
The result is a lightweight version of Eclipse completely usable and perfect for maintaining those Grails 2 applications that you might have.
Start with an Oomph
When the minimal install we just created here is not exactly what you need or you want to create some other specific version of eclipse, try using Oomph.
Oomph is an easy way to create an eclipse for each purpose because creating a new installation is very quick! You can, for instance, start with just the basic eclipse without any programming language support and start installing plugins from there.
Work fast, code happily
Happy coders make creative and productive coders! There is a lot more to tell about eclipse and the elaborate landscape of plugins that it provides for working with, for example Javascript, Regexes, your own DSL’s, etc, etc. so stay tuned for more posts!