我正在尝试使用插件与grails2.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“位置的这里不同。当我使用这个脚本用gradle grails-init创建一个grails项目时,它正确地工作,创建了这个项目。当我尝试使用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。grails的两个版本之间的jars列表是不同的,所以我不确定应该包括哪一个(或者没有jars,这是行不通的)。依赖项列表可以查看这里。
任何帮助解决这些错误将不胜感激。
使用: gradle 1.0,里程碑-7&grails2.0.0
注意事项:dependency "org.grails:grails-gradle-plugin:1.1.1-SNAPSHOT"是来自github的tip修订版的本地副本。
发布于 2012-02-20 17:58:32
非常感谢。这是一个非常有用的线程,要回答您的问题,您需要在编译中添加“org.grails:grails数据源:2.0.1”,它解决了我的机器上的问题。
发布于 2012-09-04 15:06:31
看来你失去了一些依赖..。有关如何执行此操作的完整示例,请查看Gradle / Grails应用。
希望这能有所帮助!
https://stackoverflow.com/questions/9286769
复制相似问题