Thursday, September 17, 2009

Grails - dependency resolution done right

Over the past couple of weeks I have been working on improving Grails dependency resolution capabilities for both applications and plugins. In previous versions of Grails (1.1 and below) you had limited options when it came to dependency resolution.

You could use the Grails Maven plugin, but that forced you to use, heavin forbid, Maven. We also shipped with basic Ant + Ivy support, but it was only really designed to be used for automation with continuous integration servers that support Ant and not at development time.

With Grails 1.2 this all changes with the introduction of Grails' dependency resolution DSL, which you can use to define your dependencies. Built on Ivy we have now eliminated one of the last remnants of XML usage in the Grails framework:
    dependencies {
runtime 'com.mysql:mysql-connector-java:5.1.5'
test 'junit:junit:3.8.2'
}
Grails takes application defined dependencies (defined in grails-app/conf/BuildConfig.groovy) and merges them with dependencies defined in the framework or any installed plugins. If there are conflicts you can exclude dependencies inherited from the framework or you can override plugin dependencies.

By default Grails will only resolve dependencies against your Grails installation but you can enable remote repository resolution easily:
repositories {
mavenCentral()
mavenRepo "http://repository.codehaus.org"
}
If you're addicted to your pom.xml file then we have even added the ability to read dependencies from the pom.xml instead of using the DSL. All in all, Grails 1.2 will give you significantly better control over dependencies and how they are resolved.

We're still on track to release Grails 1.2 by the end of the month, but if you want to hear more about it I'll be talking about Grails 1.2 at upcoming events such as JAOO (Denmark), SpringOne2GX (New Orleans, USA) and the Grails eXchange (London). See you there!

Thursday, May 21, 2009

Grails 1.1.1, Gr8conf, AppEngine and other happenings

Just got back from Gr8conf and really had a blast. It was a nice small group of 90-100 which meant you could really have a lot of one on one time with many of the attendees who had questions. The sessions were also not too short. Having that extra bit of time to elaborate on things makes a real different compared to the 45 minute rush you have at JavaOne et al.

All in all it felt more like a No Fluff event, which can only be described as a good thing. Right before the conference we released Grails 1.1.1 which is mainly a bug fix release, but the exciting part is the new Google AppEngine plugin which works with Grails 1.1.1

The plugin takes the heavy lifting out of configuring a Grails application for usage on AppEngine by automatically configuring the AppEngine development environment and a JDO persistence layer (JPA is coming too soon). You get reloading out of the box too, so Grails + AppEngine is really the most productive environment for developing JVM applications for AppEngine.

One missing feature from the AppEngine support right now is GORM (you have to use the raw JDO APIs). However, we are hard at work developing GORM-JPA (and potentially GORM-JDO) which will bring most of the features of GORM on top of standard JPA.

GORM-JPA is not the only exciting thing happening right now in the Grails plugin front. We are working with Adobe on integrating Flex and BlazeDS closely with Spring. The results of that can be seen in the recent Spring/BlazeDS integration 1.0 Rc2 release. The next phase is to build on top of that for the Grails plugin which is on my todo list to complete soon. Exciting times.

The plugin community itself continues to flourish, checkout these:
  • It is now finally possible to write Grails applications for different Portals such as Liferay and Pluto thanks to the Portlets plugins.
  • There is an excellent new plugin that embeds an LDAP server into Grails for easily testing LDAP
  • The Flex Scaffold plugin let's you generated complete CRUD applications using Grails and Adobe Flex
  • The Build Test Data plugin let's you quickly create dummy test data
  • Using the Spring WS plugin writing SOAP web services, feels more like writing REST service. Easy and painless.
These are just a few isolated mentions, there is activity going on all the time on the plugin space.

Tuesday, March 10, 2009

Grails 1.1 Released

Yes! Grails 1.1 is out and available for download. Checkout my blog post on the SpringSource team blog for a more detailed overview of the highlights. It is a strange feeling after a release goes out, like a mixture of relief, happiness and that "ok what now" feeling. Maybe I take software too seriously :-|

Nice to see how Twitter is abuzz with the news (note live results, link will change overtime) right now. Other than that we are now planning the launch of the Grails.org plugin portal. To support that I have been writing a few plugins for Grails. It is niceto actually write Grails apps/plugins rather than work on the internals all the time.

Anyway the result is 2 new plugins called Commentable and Taggable that allow you to generically tag and comment on domain instances. I also have a new blog plugin in the works which will power the new Grails.org blog when that is ready. Actually its already available, but I need to document it better, and I'll save that for another post.

As for beyond Grails 1.1, we are now at the planning phase, but there are loads of things we are considering from OSGi to JCR to Cloud computing. Exciting times.

Wednesday, February 11, 2009

Grails at the London Java WUG

I'll be doing a talk at the London Java Web User Group on Building Twitter with Grails in 40 Minutes on Monday the 16th of February. If you want to come a long you need to register ASAP, the last talk I did we had to turn away people as we could only fit 70 in the room.

See you there!

Grails Happenings: 1.1, Wired, Book etc.

Regular readers, I must apologize for the relative lack of updates compared to 2008, but it seems I have caught the Twitter bug, where you can get more frequent ramblings of my activities.

Nevertheless, we are progressing well with Grails 1.1 which should be out this month. Loads of exciting stuff is on the way and I am really happy with what we have achieved. The Groovy 1.6 + Grails 1.1 combination is going to be a great one.

In other news we (SpringSource) have done a case study with Wired.com about their usage of Grails. We hope to put out more case studies and white papers in the future about Grails for those looking to convince their managers that Grails is the way to go. You can download the case study here.

In other news InfoQ has a nice article up about Grails and Dynamic Jasper. For thsoe of you who don't know, InfoQ are also the organizers of QCon, which I will be speaking at in March. I'll also be doing a half day Groovy/Grails workshop at the JavaOne University this year if you're looking for a more comprehensive engagement.

Finally, Jeff and I completed The Definitive Guide to Grails, Second Edition which is a complete re-write (and a heftier one at that) of the original book with up-t0-date information covering Grails 1.0 and many of the features of Grails 1.1.