gradlegriffon

Griffon official Tutorial: unable to successfully build griffon-swing-groovy project generated with lazybones


I am following the Griffon official Tutorial but I cannot get it running using groovy as main language and swing as UI library.

This is my environment:

$ gvm version
Groovy enVironment Manager 2.4.2

$ lazybones -version
Lazybones version 0.8.1

$gradle --version
------------------------------------------------------------
Gradle 2.4
------------------------------------------------------------

Build time:   2015-05-05 08:09:24 UTC
Build number: none
Revision:     5c9c3bc20ca1c281ac7972643f1e2d190f2c943c

Groovy:       2.3.10
Ant:          Apache Ant(TM) version 1.9.4 compiled on April 29 2014
JVM:          1.8.0_45 (Oracle Corporation 25.45-b02)
OS:           Mac OS X 10.9.5 x86_64

The lazybones templates (found in $HOME/.lazybones/templates) are: griffon-javafx-java-1.3.0.zip griffon-swing-groovy-1.3.0.zip griffon-swing-java-1.3.0.zip.

As I would like to use groovy as main language and Swing as UI library, I ran the following command accepting all defaults:

$ lazybones create griffon-swing-groovy sample

Then $ cd sample and $ gradle build.

Unfortunately $ gradle build fails at :compileGroovy with the following errors:

error: SampleController does not implement griffon.core.artifact.GriffonController @griffon.metadata.ArtifactProviderFor(value=griffon.core.artifact.GriffonController.class) public class SampleController
error: SampleModel does not implement griffon.core.artifact.GriffonModel @griffon.metadata.ArtifactProviderFor(value=griffon.core.artifact.GriffonModel.class) public class SampleModel
error: SampleView does not implement griffon.core.artifact.GriffonView @griffon.metadata.ArtifactProviderFor(value=griffon.core.artifact.GriffonView.class) public class SampleView

3 errors
startup failed:
Compilation failed; see the compiler error output for details.

1 error

:compileGroovy FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileGroovy'.
> Compilation failed; see the compiler error output for details.

I understand the actual meaning of the errors, but I wonder if there is something wrong with my setup, or whether the Tutorial is just faulty.

Do you have any idea what's wrong and how I can fix it?

UPDATE: It seems that gradle v2.4 changes the way annotated code is compiled causing the build to fail. The solution is to downgrade gradle to v2.2.1. This issue is tracked on github.

For those who might be interested, you can install multiple versions of gradle through gvm as follow:

$ gvm install gradle 2.2.1

If you want to see what versions are available (and which one is currently in use) issue the following command:

$ gvm list gradle

Thanks in advance, zxxz


Solution

  • Downgrading to gradle v2.2.1 allows a successful build. I updated my own question with further details.