Quick post on specifying Grails dependencies in BuildConfig.groovy. The recommended way to suck in JAR dependencies in Grails is to use the dependencies DSL maintained in BuildConfig.groovy. I had a need to bring down a dependency that has a classifier attribute on it. Didn't really find anything definitive on how to do it, but it seemed like following a convention might do the trick. Here's how I solved the issue:
repositories {
grailsPlugins()
grailsHome()
grailsCentral()
mavenCentral()
ebr() // SpringSource Enterprise Bundle Repository
}
dependencies {
runtime group:'net.sf.json-lib', name:'json-lib', version:'2.4', classifier:'jdk15'
}
I tried this configuration but still get a not found error. Is there something missing?
ReplyDeleteI also have mavenCentral() and ebr() enabled for remote dependency resolution. I will edit my blog to include that information. I just put together a quick Grails app and included this dependency and I was able to get it to resolve.
ReplyDeleteHello Christopher, I appreciate you taking a look. Unfortunately, those changes did not work either. I was able to get it working with the 2.2.3 version of the jar. I enabled all the default repo's in the buildConfig and added the ebr() repo too. None of the repo's could resolve the jar.
ReplyDeleteI am not sure if this post has anything to do with the problem but I thought I would mention it.
http://jira.grails.org/browse/GRAILS-6147
Chris,
ReplyDeleteThat's really odd. It worked fine for me on Grails 1.3.7. I believe that this whole dependency goes away in Groovy 1.8 with the inclusion of JsonSlurper and JsonParser as part of the core:
http://groovy.329449.n5.nabble.com/Built-in-JSON-support-in-1-8-td3361699.html
Sorry my solution did not work for you.
-- chris --
Nice post. Keep sharing. Thanks for sharing.
ReplyDeleteVisit Best Astrologer in Sangareddy
Amazing blog post,Thank you.
ReplyDeletevisit here
Sofa Refurbishing in HAL