Griffon 2.7 Tutorial

2019-07-09 00:32发布

问题:

Following the official tutorial on griffon-framework.org/tutorials/1_getting_started.html .. Installed lazybones / gradle .. Created the sample application as per tutorial .. Tried to run gradle build and get

$ gradle run --info
Starting Build
Settings evaluated using settings file 
'C:\cygwin64\home\Rob\sample\settings.gradle'.
Projects loaded. Root project using build file 
C:\cygwin64\home\Rob\sample\build.gradle'.
Included projects: [root project 'sample']
Evaluating root project 'sample' using build file
C:\cygwin64\home\Rob\sample\build.gradle'.
Adding license extension
Adding download licenses extension
Adding license extension rule
Adding license tasks for sourceSet licenseMain
Adding license tasks for sourceSet licenseTest
Applying license defaults to task: :licenseFormatMain
Applying license defaults to task: :licenseFormatTest
Applying license defaults to task: :licenseMain
Applying license defaults to task: :licenseTest
Applying defaults to download task: :downloadLicenses
Adding license tasks for sourceSet licenseIntegrationTest
Applying license defaults to task: :licenseIntegrationTest 
Applying license defaults to task: :licenseFormatIntegrationTest

FAILURE: Build failed with an exception.

* Where:
Script 'C:\cygwin64\home\Rob\sample\gradle\integration-test.gradle' line: 20

* What went wrong:
A problem occurred evaluating script.
> Could not find property 'compileOnly' on configuration container.

The script it's objecting to ..

sourceSets {
    integrationTest {
        if (file('src/integration-test/java').exists()) {
            java.srcDirs file('src/integration-test/java')
        }
        if (file('src/integration-test/groovy').exists()) {
            groovy.srcDirs file('src/integration-test/groovy')
        }
        resources.srcDir file('src/integration-test/resources')
        compileClasspath += sourceSets.main.output
        compileClasspath += configurations.compileOnly      <-- line 20 
        compileClasspath += configurations.testCompileOnly
        runtimeClasspath += compileClasspath
    }
}

Gradle info

------------------------------------------------------------
Gradle 2.2.1
------------------------------------------------------------

Build time:   2014-11-24 09:45:35 UTC
Build number: none
Revision:     6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a

Groovy:       2.3.6
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.7.0_79 (Oracle Corporation 24.79-b02)
OS:           Windows 8.1 6.3 amd64

Anyone point me in the right direction ? I'm new to both Gradle and Griffon 2.7 .. Thanks ..

回答1:

I believe that compileOnly was introduced in Gradle 2.12 (from this blog post).

I realize the Griffon doc states "Gradle 2 is the minimum supported version" but that may be obsolete.