我有一個Grails 2.2.4項目,我正在升級到Grails 2.4.3。我認爲,除了我們的本地jar沒有解決任何問題之外,我主要瀏覽了依賴項更改。如何獲取grails 2.4.3來解決<project-dir>/lib中的依賴關係?
具體而言,我們的項目取決於我們的lib
目錄中的幾個罐子 - 例如,newrelic-api-2.18.0.jar
。每當我嘗試編譯項目時,我得到這個錯誤:
| Error Resolve error obtaining dependencies: The following artifacts could not be resolved: newrelic:newrelic-api:jar:2.18.0 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
...這是完全公平的,只要有雲:那罐子真的不grailsCentral,它在my-project/lib
。那麼,我該如何讓Grails在那裏尋找它?
我們所有的本地依賴無法通過這種方式解決。我們所有的遠程依賴都可以正確解析(至少,我們只是對Hibernate版本做了一些小改動)。我可以通過註釋掉所有本地依賴項來獲得依賴性解決方案,但是當然編譯後來會有一堆NoClassDefFoundError
s。
當我切換回2.2.4時,一切都很好:依賴性被正確解決,應用程序加載時沒有問題。
這裏是我的buildConfig的頭:
grails.servlet.version = "2.5"
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
grails.project.dependency.resolver = "maven"
grails.project.dependency.resolution = {
cacheDir "target/ivy-cache"
inherits("global") { }
log "warn"
checksums true
legacyResolve true // whether to do a secondary resolve on plugin installation, not advised and here only for backwards compatibility
repositories {
inherits true
grailsPlugins()
grailsHome()
grailsCentral()
mavenLocal()
mavenCentral()
}
dependencies {
runtime 'newrelic:newrelic-api:2.18.0'
// ...various other deps, plugins, and whatnot...
}
}
我在做什麼錯?在發行說明中我沒有看到有關此問題的任何討論,所以它肯定不能成爲所有依賴性更改的預期結果。