【问题标题】:Grails Plugins from GitHub来自 GitHub 的 Grails 插件
【发布时间】:2013-08-29 11:58:33
【问题描述】:

如果我想使用来自 Git Hub 的 Grails 插件。我是否只需下载 zip 文件并使其在本地 maven 存储库中可用?我在防火墙后面,它不允许我解决依赖关系。

【问题讨论】:

    标签: grails


    【解决方案1】:

    您可以获取源代码并运行maven-install 以使其在本地maven 存储库中可用,然后在BuildConfig.groovy 的插件块中声明依赖项。

    【讨论】:

      【解决方案2】:

      您不应该从 repo 源构建,因为这可能包含未完成的功能和错误。至少使用为特定版本标记的源(如果有的话)。

      如果你想下载已发布的插件,可以在http://repo.grails.org/grails/plugins/org/grails/plugins/获得它们

      请记住,在 2.3 中运行 grails install-plugin /path/to/zip 不再有效,因此您应该远离这种方法。相反,您可以运行一个本地 Artifactory 实例,该实例充当缓存插件存储库 - 请参阅此线程以获取一些入门信息:http://grails.1312388.n4.nabble.com/Caching-plugins-using-artifactory-td4640164.html

      【讨论】:

        【解决方案3】:

        将下载的 zip 文件将是插件的来源。您必须解压缩 zip,转到插件的根目录,然后运行 ​​grails maven-install(来自发布插件),如果您有一个设置,它将在本地 maven 存储库中为您构建插件工件。

        然后就可以使用插件了。

        您可以使用in this answer 中提到的内联插件。

        【讨论】:

          【解决方案4】:

          代理设置也可以通过添加代理和设置代理在grails中进行配置。

          grails add-proxy myproxy "--host=myproxy" "--port=myport" "--username=proxyuser" "--password=mypassword" grails set-proxy myproxy see grails docs.

          如果上述解决方案不起作用,请尝试 在 C:\Documents and Settings\user-name.grails 文件夹中创建 ProxySettings.groovy

          在此文件中添加以下两行并保存

          myproxy=["http.proxyHost":"myproxy", "http.proxyPort":"4300", "http.proxyUserName":"proxyuser", "http.proxyPassword":"mypassword"] 
          currentProxy="myproxy"
          

          please check this link for more options

          【讨论】:

            【解决方案5】:

            您还可以按照此处所述将插件保存在本地

            http://blog.armbruster-it.de/2011/10/project-setup-for-grails-with-customized-plugins-using-git-submodules/

            git submodule add git://github.com/sarmbruster/grails-spring-security-ui.git plugins/grails-spring-security-ui
            git add .gitmodules plugins/
            git commit -m "added submodule"
            

            现在通过添加到 grails-app/conf/BuildConfig.groovy 来添加 plugins/grails-spring-security-ui 作为内联插件

            grails.plugin.location.'spring-security-ui'="plugins/grails-spring-security-ui"
            

            就是这样。

            文档中“安装本地插件”和“指定插件位置”部分的更多信息: http://grails.org/doc/latest/guide/plugins.html#12.1%20Creating%20and%20Installing%20Plug-ins

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 2011-09-15
              • 2011-02-02
              • 1970-01-01
              • 2013-11-13
              • 2012-05-23
              • 1970-01-01
              相关资源
              最近更新 更多