GRAILS.IO Avatar

Posts tagged grails

Road to Grails 2.3: Improved Dependency Resolution

During the various Grails conferences last year (2GX, Gr8conf, Grails Exchange etc.) there were significant numbers of people who commented that dependency resolution was their biggest problem with Grails.

We’ve made improvements in this area already, in Grails 2.1 we introduced proper Maven support, but that still requires you to use the Maven build tool. Folks using the normal Grails command line have been stuck with Ivy. Starting with the upcoming Grails 2.3 release you will be able to switch to Aether as the default dependency manager by adding the following line to your BuildConfig:

grails.project.dependency.resolver = “maven”

What is Aether? Aether is the dependency resolution library used by Maven itself for resolution. What this means is that several problems users have had with Ivy go away, including:

  • Problematic snapshot handling (Ivy doesn’t deal with snapshots the same as Maven)
  • Issues with different packaging types used in POMs
  • Lack of support for repository URLs in POMs (although this is discouraged)
  • Problems with complex POMs and classifiers

In addition to this, to help users diagnose dependency resolution failures we have shamelessly borrowed/stolen Gradle’s dependency graph output for Grails’ dependency-report command:

And when you get dependency resolution failures you get nice output highlighting the dependency that failed to resolve:

There have been numerous internal framework improvements as well to reduce the number of dependency, cleanup Grails’ transitive dependencies and ensure issues like 2 plugins with the same version conflicting don’t happen.

Of course, we still have on the roadmap to move to Gradle in Grails 3.0, but in the meantime Grails 2.x users should have something to look forward to ease any dependency resolution woes.

Grails Unit Testing and a little fun with @Before

Interesting post, the unpredictable ordering of JUnit @Before methods is a real problem. Anyone know a solution to this for JUnit 4?

Excellent Building Google Calendar in Grails Tutorial Series

Craig Burke has put together an excellent series demonstrating building a Google Calendar type application using Grails and jQuery.

The MongoDB NoSQL Database Blog: Groovy on Grails in the Land of MongoDB

mongodb:

Groovy and Grails’ speed and simplicity are a perfect match to the flexibility and power of MongoDB. Dozens of plugins and libraries connect these two together, making it a breeze to get Grooving with MongoDB.

Using Grails with MongoDB

For the purpose of this post, let’s pretend we’re writing a…

Grails 2.0.1 Available…

Today we put out Grails 2.0.1, we’ve been keeping our eyes open for folks who are having trouble upgrading and trying to proactively fix the issues that people encounter during an upgrade.

Grails 2.0.1 is the result of that work and includes over 80 bug fixes and improvements, hopefully paving the way for more folks to upgrade. 

Let us know if you’re having trouble and we’ll prioritize the issue.

O'Reilly: Mastering Grails 101 Video

Check out this 3 hour+ screencast of starting out with Grails 2.0 by the excellent duo Tim Berglund and Matthew McCullough. Nice to see some professional level screencasts out there.

Call for testing of existing Maven plugin

If anybody out there has the time please test out Maven plugin for Grails 2.0 and report back any issues. Instructions for setup can be found here.

Nice installing Grails 2.0 on OS X screencast for beginners. See also Installing Grails 2.0 on Windows for those less fortunate.

Functional testing Grails core with Gradle, Spock and Geb

Today I pushed a new functional test suite for Grails that is based on Gradle, Spock and Geb.

I have been relatively frustrated with our existing functional test suite and wanted to modernize it to take advantage of all the latest innovations happening in the Groovy testing community.

The requirements fulfilled by the new test suite are as follows:

  • Allow tests to be created in a standard Gradle structure 
  • Allow tests to be run from the IDE
  • Enable easy scripting of the Grails command line
  • Enable easy web function testing of the running application

An example of what I came up with can be seen below:

 class RunAppSpec extends BaseSpec { void "Test run-app starts correctly"() { given:"A new project" grails { createApp "test" runApp() } when:"The home page is requested" go "" then:"The Grails welcome page is shown" title == "Welcome to Grails" } } 

As you can see the Grails command line can be easily scripted with the grails block. Then testing of web UIs is left to Geb’s DSL.

Hopefully this will also make it easier for folks to contribute functional tests. Please feel free to fork the repository and send us a pull request!