我可以知道为什么在使用grails-gradle-plugin时不能用systemProperty方法设置系统属性吗?
我的build.gradle如下:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.grails:grails-gradle-plugin:2.0.0"
}
}
version "0.1"
group "example"
apply plugin: "grails"
repositories {
grails.central() //creates a maven repo for the Grails Central repository (Core libraries and plugins)
}
grails {
grailsVersion = '2.3.5'
groovyVersion = '2.1.9'
springLoadedVersion '1.1.3'
}
dependencies {
bootstrap "org.grails.plugins:tomcat:7.0.50" // No container is deployed by default, so add this
compile 'org.grails.plugins:resources:1.2' // Just an example of adding a Grails plugin
}
test {
println "I'm in the test"
//Could not find method systemProperty() for arguments [geb.env, sauce] on root project
systemProperty 'geb.env', 'sauce'//Fails
}在测试任务中,当我运行$gradle grails-test时,我得到了以下错误:找不到参数systemProperty()的方法geb.env,sauce on root project...“
这是不是grails-gradle插件的问题,因为像"java“这样的插件允许我使用setProperty?谢谢。
发布于 2016-02-05 03:36:26
错误消息是正确的:没有systemProperty()方法。
正如Joshua Moore评论的那样,这应该是可行的:
test {
println "I'm in the test"
System.setProperty 'geb.env', 'sauce'
}https://stackoverflow.com/questions/22602541
复制相似问题