我遵循这个格里芬官方教程,但是我不能使用groovy作为主语言,swing作为UI库来运行它。
这是我的环境:
$ 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_64lazybones模板(在$HOME/.lazybones/templates中找到)是:griffon-javafx-java-1.3.0.zip griffon-swing-groovy-1.3.0.zip griffon-swing-java-1.3.0.zip。
由于我希望使用groovy作为主语言,使用Swing作为UI库,因此我运行了以下命令,接受所有默认值:
$ lazybones create griffon-swing-groovy sample然后是$ cd sample和$ gradle build。
不幸的是,$ gradle build在:compileGroovy上失败,有以下错误:
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.我理解这些错误的实际意义,但我不知道我的设置是否有问题,或者该教程是否有错误。
你知道是怎么回事吗?我怎么能修好它?
更新:gradle v2.4似乎改变了编译注释代码的方式,导致构建失败。解决方案是将gradle降级为v2.2.1。此问题在github上被跟踪。
对于可能感兴趣的人,您可以通过gvm安装多个版本的gvm,如下所示:
$ gvm install gradle 2.2.1如果要查看可用的版本(以及当前正在使用的版本),请发出以下命令:
$ gvm list gradle提前谢谢,zxxz
发布于 2015-06-18 19:14:57
降级到gradle v2.2.1允许成功构建。我用更多的细节更新了我自己的问题。
发布于 2015-06-18 18:50:12
实际上,问题在于Gradle 2.4添加了对Groovy源代码的APT支持,它打破了Jipsy/Gipsy。目前的解决办法是将评级下调至2.3级。
https://stackoverflow.com/questions/30915683
复制相似问题