Gradle插件不支持Grails 2.2.3

时间:2014-02-21 05:13:25

标签: grails gradle grails-plugin build.gradle grails-2.2

我刚刚用grails-2.2.3创建了一个示例应用程序。当我使用grails run-app运行此应用程序时,它正常工作,但客户端希望使用gradle来构建应用程序。我已经安装了grails-gradle插件并设置了应用程序。当我运行没有任何域的gradle grails-run-app时,它可以正常工作。但是,当我创建一个域并尝试引导数据时,它会抛出以下异常

| Error 2014-02-21 10:28:54,355 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing Grails: groovy.lang.MissingMethodException: No signature of method: com.user.User.save() is applicable for argument types: () values: []
Possible solutions: save(), save(boolean), save(java.util.Map), wait(), last(), any()
Message: groovy.lang.MissingMethodException: No signature of method: com.user.User.save() is applicable for argument types: () values: []
Possible solutions: save(), save(boolean), save(java.util.Map), wait(), last(), any()
   Line | Method
->> 308 | evaluateEnvironmentSpecificBlock in grails.util.Environment
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   301 | executeForEnvironment            in     ''
|   277 | executeForCurrentEnvironment . . in     ''
|   303 | innerRun                         in java.util.concurrent.FutureTask$Sync
|   138 | run . . . . . . . . . . . . . .  in java.util.concurrent.FutureTask
|   895 | runTask                          in         java.util.concurrent.ThreadPoolExecutor$Worker
|   918 | run . . . . . . . . . . . . . .  in     ''
^   662 | run                              in java.lang.Thread

Caused by MissingMethodException: No signature of method: com.user.User.save() is applicable for argument types: () values: []
Possible solutions: save(), save(boolean), save(java.util.Map), wait(), last(), any()

我附上了重现相同的源代码。 https://www.dropbox.com/sh/w4z1z6pyc22dqqz/m08RdilDCv请从此处下载该应用程序。

由于 阿米特

1 个答案:

答案 0 :(得分:1)

我看起来build.gradle我发现你已经排除了hibernate依赖

compile {
    exclude module: 'hibernate'
} 

删除后,我可以运行该应用程序。

请亲自试试并告诉我。