Web Development Evolved: Grails 2.0 Released!

Engineering | Graeme Rocher | December 15, 2011 | ...

After nearly a year in development, we are extremely excited to announce the GA release of Grails 2.0 - the second major revision of the web framework that is changing the face of web development on the JVM.

This release brings a greatly enhanced user experience. Everything from the command line, to the test reports, to the UIs that Grails generates for you have been rethought and reinvented. Some of the exciting features available in Grails 2.0 include:

  • A new console UI incorporating tab completion and coloured output
  • A better and more reliable reloading mechanism, resulting in far fewer server restarts
  • Enhanced error reporting and problem diagnosis
  • The latest and greatest libraries: Groovy 1.8, Spring 3.1, Hibernate 3.6 and Servlet 3.0
  • A powerful framework for static resources (CSS, Javascript, etc.)
  • New APIs for link generation and page rendering
  • New GORM features: detached criteria, Where queries, multiple data sources, and more
  • Standard plugins for database migrations and reverse engineering
  • New unit testing API with full GORM emulation
  • … plus hundreds of smaller improvements

All of these new features are covered in great detail in the “What’s new in Grails 2.0?” section of the user guide. Also be sure to check out the Grails 2.0 webinar and the “Countdown to Grails 2.0” blog series by Peter Ledbrook:

As well as all of these new features, during the development of Grails 2.0 the Grails team has fixed over 900 issues and continued to evolve the plugin ecosystem around Grails.

During the course of the development of Grails 2.0 the source code has evolved in a number of significant ways. We modularized the source code by shifting to Gradle as a build tool; we now use Artifactory for repository management; Spock has become our defacto testing tool; and we rewrote the internals to take advantage of Groovy AST transformations. Grails is significantly better off with all these changes and users will see the benefit in Grails 2.0.

In addition to the release of Grails 2.0, we have a number of other exciting announcements to make starting with the Cloud.

Grails 2.0 in the Cloud

For those following the Cloud space (and who isn’t!) you’ll be pleased to know that Grails 2.0 is already Cloud ready. Cloud Foundry - the open PaaS by VMware - supports Grails 2.0 out of the box and we have already been working towards migrating the Grails website to cloudfoundry.com!

Checkout this excellent blog post by Peter Ledbrook on One-step deployment with Grails and Cloud Foundry, which shows how to get started with Cloud Foundry Deployment using the Cloud Foundry plugin for Grails.

The Heroku guys have also announced Grails support - enabling the continuous deployment of Grails apps to Heroku’s cloud platform. Grails applications can be deployed with a simple “git push” which triggers a complete build and deployment workflow.

To get started with Grails on Heroku, follow this Grails quick start guide. Grails deployment to Heroku is currently in public beta.

Cloud will continue to be a huge theme in 2012 with the emergence of more Cloud platforms that support Grails, many of which will be based on Open Source Cloud Foundry.

Grails 2.0 in Your IDE

For Eclipse users, SpringSource Tool Suite (STS) version 2.9.0.M1 (available December 2011) provides the best support for Grails 2.0. STS version 2.8.1 provides much of the basic support for those not ready to rely on a milestone release. STS releases are available here: http://www.springsource.com/downloads/sts

The most recent New and Noteworthy for STS is available here: http://download.springsource.com/release/STS/doc/STS-new_and_noteworthy.pdf It describes all the latest enhancements for Groovy and Grails development.

The support forum for any issues with STS you might have is here: http://forum.springsource.org/forumdisplay.php?32-SpringSource-Tool-Suite

For Intellij IDEA users, JetBrains have been busy working on the development of Intellij IDEA 11 which was released last week. Intellij IDEA 11 contains a bunch of new features to support Grails 2.0 so make sure you upgrade before getting started with Grails 2.0 and Intellij IDEA.

Grails 2.0 and NoSQL

Grails 2.0 is the first release of Grails that truly abstracts the GORM layer so that new implementations of GORM can be used.

With the release of Grails 2.0 we are also pleased to announce the release of a number of Grails 2.0 compatible plugins for NoSQL data stores:

The MongoDB plugin is at final release candidate stage and is based on the excellent Spring Data MongoDB project which is also available in RC form.

In addition, we have put together a developer guide on how to go about building an implementation of GORM for folks who wish to participate in the project.

Grails users can look forward to more exciting NoSQL announcements in 2012 with upcoming  future releases of GORM for Neo4j, Amazon SimpleDB and Cassandra in the works.

Acknowledgements

Beyond the hard work of the Grails team at SpringSource I wish to extend a special thanks to our awesome external contributors. In no particular order:
  • Lari Hotari - for his tireless work optimizing Grails performance that has resulted in significant performance gains for Grails 2.0 over 1.3.x
  • Marc “Grails Rocks” Palmer - for his dedication to the development of the simply outstanding resources plugin, which is bundled with Grails 2.0, that allows the management of static resources (bundling, caching, gzipping, deferred loading etc.) without the pain
  • Rob Fletcher - for the awesome update to HTML5 in Grails 2.0’s default scaffolding templates
  • Luke Daley - for continuing to contribute to making Grails’ existing build system and dependency management as good as it can be prior to our eventual migration to Gradle.
  • Stephane Maldini - for making a significant contribution to the work to migrate Grails configuration model from runtime metaprogramming to AST transformation-based approach.
  • … and last, but not least, all those who have submitted Github pull requests during the course of the development of Grails 2.0

Also a special thanks to the JFrog team for providing us with a hosted Artifactory Online instance to manage Grails’ dependencies and to the Gradleware team for making the migration of our Ant build system to Gradle completely pain-free. Gradle has significantly streamlined our build process without sacrificing any flexibility and I would recommend it to any project that requires modularization.

Useful Links

Get the Spring newsletter

Thank you for your interest. Someone will get back to you shortly.

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring Runtime offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all