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!

5 comments:

sarbogast said...

And how does a Maven-built application work with a plugin using your dependency DSL? Because I've developed grails-apns plugin using your dependency DSL. And then I have a Grails 1.2 application with apns plugin installed in it. This application runs great with grails alone, but when I try to run it with Maven, I get ClassNotFoundException's for all the classes that are in the libraries my plugin depends on. Is it normal?

she said...

Better late than never. .........................................

sport8341 said...

hello everyone welcome to visit our stations ,chaussures pas cher|Air Max|there are many thingsChaussures Sport|NFL Jerseys|you needcell phones
NFL Jerseys|tn chaussures|chaussures puma|Tn RequinCheap Polo
Chaussures Nike Sport
you must visit!!!

念強 said...

感覺很好的blog,祝你開心喔........................................

淑純淑純 said...

上床圖片av圖片免費色情圖台灣性網陰蒂淫妹貼圖色情激突成人論壇成人色情網激情成人聊天室情色影音鹹濕女生自慰影片淫慾自慰色情a片成人色情圖片網情人視訊網成人話題成人色情台灣成人淫蕩a圖片情色留言板女生奶頭情色成人全裸美女圖片情色寫真裸體照大奶子台灣色情成人網站一夜正妹美女裸體寫真g罩杯美女sex520情趣娃娃視訊打槍視訊辣妹uthome淫亂走光照av情色網女生高潮成人自拍火辣眉眉太太陰毛美女視訊聊天全裸入鏡火辣av三點全露