【问题标题】:Griffon official Tutorial: unable to successfully build griffon-swing-groovy project generated with lazybonesGriffon 官方教程:无法成功构建使用lazybones 生成的griffon-swing-groovy 项目
【发布时间】:2015-06-18 12:43:22
【问题描述】:

我正在关注Griffon official Tutorial,但我无法使用 groovy 作为主要语言并将其作为 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_64

lazybones 模板(在 $HOME/.lazybones/templates 中找到)是:griffon-javafx-java-1.3.0.zipgriffon-swing-groovy-1.3.0.zipgriffon-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 上跟踪。

对于那些可能感兴趣的人,您可以安装多个版本的gradlegvm,如下所示:

$ gvm install gradle 2.2.1

如果您想查看可用的版本(以及当前正在使用的版本),请发出以下命令:

$ gvm list gradle

提前致谢, zxxz

【问题讨论】:

    标签: gradle griffon


    【解决方案1】:

    降级到gradle v2.2.1 可以成功构建。我用更多细节更新了我自己的问题。

    【讨论】:

      【解决方案2】:

      确实,问题在于 Gradle 2.4 添加了对 Groovy 源代码的 APT 支持,这破坏了 Jipsy/Gipsy。解决方法是同时降级到 Gradle 2.3。

      【讨论】:

      • 实际上降级到gradle v2.3 并不能完全解决问题。事实上它可以编译,但构建本身在:signJars 上失败。降级到gradle v2.2.1 可以成功构建。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多