我正在尝试将 grails-gradle 插件与 grails 2.0 版一起使用。这是我的构建脚本:
buildscript {
repositories {
mavenRepo url: "http://repo.grails.org/grails/core/"
}
dependencies {
classpath "org.grails:grails-gradle-plugin:1.1.1-SNAPSHOT",
"org.grails:grails-bootstrap:2.0.0"
}
grailsVersion="2.0.0"
}
apply plugin: "grails"
repositories {
mavenCentral()
mavenRepo url: "http://repo.grails.org/grails/core/"
}
dependencies {
compile "org.grails:grails:2.0.0",
"org.grails:grails-core:2.0.0",
"org.grails:grails-crud:2.0.0",
"org.grails:grails-datastore-core:1.0.2.RELEASE",
"org.grails:grails-datastore-gorm:1.0.2.RELEASE",
"org.grails:grails-hibernate:2.0.0",
"org.grails:grails-logging:2.0.0"
}
脚本底部的依赖项与位于此处的原始“1.3.4”不同。当我使用此脚本创建一个 grails 项目时,gradle grails-init
它可以正常工作,创建项目。当我尝试使用时,gradle grails-run-app
我收到以下错误:
~>gradle grails-run-app
:grails-run-app
| Configuring classpath
| Error log4j:WARN No appenders could be found for logger (org.springframework.core.io.support.PathMatchingResourcePatternResolver).
| Error log4j:WARN Please initialize the log4j system properly.
| Error log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
| Compiling 38 source files
| Compiling 8 source files.....
| Error Error: The following plugins failed to load due to missing dependencies: [hibernate]
- Plugin: hibernate
- Dependencies:
! dataSource (Required: 2.0 > *, Found: Not Installed) [INVALID]
- i18n (Required: 2.0 > *, Found: 2.0.0)
- core (Required: 2.0 > *, Found: 2.0.0)
- domainClass (Required: 2.0 > *, Found: 2.0.0)
我假设这意味着我缺少一个依赖项,但我不知道是什么依赖项。看起来hibernate
是罪魁祸首,但我在上面包含了 grails hibernate jar。两个版本的 grails 之间的 jar 列表是不同的,所以我不确定应该包括哪个(或者可能没有一个,这将不起作用)。可以在此处查看依赖项列表。
任何解决这些错误的帮助将不胜感激。
使用:gradle 1.0、里程碑 7 和 grails 2.0.0
注意:依赖项是来自github"org.grails:grails-gradle-plugin:1.1.1-SNAPSHOT"
的最新修订版的本地副本。