Thursday, April 8, 2010

Grails tips: using custom Ivy repositories

Starting from Grails 1.2.x, Ivy has been chosen as the default dependency resolution mechanism for libraries; however, the official user guide doesn't explain very well how to configure a custom repository.

The BuildConfig.groovy
Following the guide, the BuildConfig.groovy is the place where both dependencies and resolvers are configured. It is placed on [app-name]/grails-app/conf of every grails application.

We need to configure Grails to use the our custom repository by adding an appropriate dependency resolver; note that you can add as many as you want simply by configuring them and then calling the resolver method, like the following example:


That's all! Now you can declare your dependencies on the dependencies closure.