Grails 2.0的Grails/Gradle插件
我试图在grails 2.0版中使用grails gradle插件。以下是我的构建脚本:Grails 2.0的Grails/Gradle插件,grails,plugins,grails-plugin,gradle,grails-2.0,Grails,Plugins,Grails Plugin,Gradle,Grails 2.0,我试图在grails 2.0版中使用grails gradle插件。以下是我的构建脚本: buildscript { repositories { mavenRepo url: "http://repo.grails.org/grails/core/" } dependencies { classpath "org.grails:grails-gradle-plugin:1.1.1-SNAPSHOT",
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 hibernate jar。grails的两个版本之间的jar列表是不同的,所以我不确定应该包括哪些jar(或者可能没有jar,这将不起作用)。可以查看依赖项列表
如果您能帮助解决这些错误,我们将不胜感激
使用:
gradle 1.0、milestone-7和grails 2.0.0
注意:依赖项
“org.grails:grails gradle plugin:1.1.1-SNAPSHOT”
是来自的tip修订版的本地副本 非常感谢。这是一个非常有用的线程,为了回答您的问题,您需要在编译时添加“org.grails:grails plugin datasource:2.0.1”,它解决了我机器上的问题。看起来您缺少一些依赖项。。。检查如何执行此操作的完整示例
希望这有帮助 我尝试过这个,但它仍然不适用于“grails run app”。它将初始化并组装一个项目,但我无法运行它。