3.5-rc-2
版本和do
./gradlew test
它将失败,并出现以下错误:
FAILURE: Build failed with an exception.
* Where:
Build file '/home/wololock/workspace/idea/stackoverflow-answers/46009278/build.gradle' line: 11
* What went wrong:
A problem occurred evaluating root project '46009278'.
> Failed to apply plugin [id 'ratpack-groovy']
> Could not find method groovy() for arguments [DefaultExternalModuleDependency{group='io.ratpack', name='ratpack-groovy', version='0.9.4', configuration='default'}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
现在,如果我们看看这个例子开发时使用了什么Gradle版本,我们会发现它使用了Gradle
1.10
gradle-wrapper.properties
文件:
#Sun Jul 21 19:00:37 CDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip
如果定义相同的Gradle包装器版本并执行以下操作:
./gradlew试验
或
./gradlew runFatJar
10:39:44: Executing external task 'runFatJar'...
The groovy configuration has been deprecated and is scheduled to be removed in Gradle 2.0. Typically, usages of 'groovy' can simply be replaced with 'compile'. In some cases, it may be necessary to additionally configure the 'groovyClasspath' property of GroovyCompile and Groovydoc tasks.
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:fatJar
wrz 02, 2017 10:39:48 AM ratpack.server.internal.NettyRatpackServer start
INFO: Ratpack started for http://localhost:5050
:runFatJar
Sat Sep 02 10:40:40 CEST 2017 - received blocking request
Sat Sep 02 10:40:50 CEST 2017 - replying blocking request
Sat Sep 02 10:40:50 CEST 2017 - received non-blocking request
Sat Sep 02 10:41:00 CEST 2017 - replying non-blocking request