【发布时间】:2015-07-04 01:33:28
【问题描述】:
我正在尝试使用 gradle-grails-plugin 来构建现有的(小型)Grails 项目。这应该工作吗? build.gradle中的依赖和buildConfig.groovy中指定的依赖是什么关系?
无论如何,我有两个项目,所以最上面的build.gradle 文件在父目录中,看起来像:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.grails:grails-gradle-plugin:2.2.0.RC1"
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
然后Grails项目中的build.gradle如下:
apply plugin: "grails"
repositories {
grails.central() //creates a maven repo for the Grails Central repository (Core libraries and plugins)
}
grails {
grailsVersion = '2.4.4'
groovyVersion = '2.3.9'
springLoadedVersion '1.2.0.RELEASE'
}
dependencies {
bootstrap "org.grails.plugins:tomcat:7.0.55.3"
compile 'org.grails.plugins:asset-pipeline:3.0.1'
compile 'org.grails.plugins:scaffolding:2.1.2'
compile 'org.grails.plugins:cache:1.1.8'
runtime 'org.grails.plugins:hibernate4:4.3.1.1'
runtime 'org.grails.plugins:database-migration:1.3.8'
runtime 'org.grails.plugins:jquery:1.11.0'
}
但是,当我运行 ./gradlew war 时,我会返回:
Caused by: java.long.ClassNotFoundException: grails.artefact.Service
任何人都可以对此有所了解吗?几乎没有通过谷歌引用它,它似乎是一个 Grails 3.x 类?另外,我使用的是 Java 1.7。
【问题讨论】:
标签: grails gradle grails-plugin build.gradle