1

我需要在 2.2.1 中使用 Grails“发布”插件,并将其添加到下面的 BuildConfig.groovy 中的插件中:

    plugins {
        runtime ":hibernate:$grailsVersion"
        runtime ":jquery:1.8.3"
        runtime ":resources:1.1.6"
        build ":tomcat:$grailsVersion"
        runtime ":database-migration:1.3.2", ":cors:1.1.0"
        compile ':cache:1.0.1'
        build ":release:2.2.1"
    }

我尝试运行 maven-deploy:

$ grails prod maven-deploy --repository=releases --verbose --non-interactive
| Loading Grails 2.2.1
| Error WARNING: Configurational method [:release:2.2.1] in grails-app/conf/BuildConfig.groovy doesn't exist. Ignoring..
| Error WARNING: Configurational method [build] in grails-app/conf/BuildConfig.groovy doesn't exist. Ignoring..
| Running pre-compiled script
| Error Script not found: MavenDeploy

或(在 BuildConfig.groovy 中从构建更改为编译时):

| Running pre-compiled script
| Error Script not found: MavenDeploy

我尝试列出发布插件不存在的插件:

$ grails list-plugins --installed
Plug-ins you currently have installed are listed below:
-------------------------------------------------------------
cache               1.0.1            --  Cache Plugin
common-domain       1.2.4            --  Common Domain Plugin
cors                1.1.0            --  CORS Plugin
database-migration  1.3.2            --  Grails Database Migration Plugin
hibernate           2.2.1            --  Hibernate for Grails
jquery              1.8.3            --  JQuery for Grails
resources           1.1.6            --  Resources
tomcat              2.2.1            --  Apache Tomcat plugin for Grails
webxml              1.4.1            --  WebXmlConfig

我使用已弃用的 install-plugin 目标让它工作。我不知道为什么这不起作用,并且想知道是否有人可以对此有所了解。谢谢

4

2 回答 2

3

在插件中添加条目后,执行 aBuildConfig.groovy或仅. 我通常更喜欢.releasegrails compilegrails run-appgrails clean && grails compile

清理和编译后,您可以检查已安装的插件列表
grails list-plugins --installed

它一直在为我工作。:-)

于 2013-06-25T19:52:47.807 回答
0

确保 $GRAILS_HOME 环境变量已设置并指向文件系统上的正确位置。

于 2014-06-24T23:41:21.883 回答