为什么grails run-app在编译期间尝试访问远程服务器

时间:2013-03-18 06:21:13

标签: grails

我发现在我的grails应用程序编译期间有一些错误。

| Loading Grails 2.0.4
| Configuring classpath
:: problems summary ::
:::: ERRORS
Server access Error: Unexpected end of file from server 
url=http://plugins.grails.org/grails-shiro/tags/RELEASE_1_2_0-SNAPSHOT/shiro-1.2.0-SNAPSHOT.pom

但我可以使用我的浏览器访问上面的网址。错误是什么意思?有没有办法在编译期间避免这些问题?或者我可以在本地编译我的grails应用程序吗?

当我需要一些grails插件时,我经常跑     grails install-plugin xxx 安装xxx插件。我注意到有一些记录自动写在'application.properties'中。插件总是安装在我的〜/ .grails // projects / plugins /中,我想知道是否有办法在本地编译grails app?

1 个答案:

答案 0 :(得分:8)

你有一个SNAPSHOT插件,这意味着Grails必须定期刷新这个插件(每天一次)。

要禁用远程存储库,您可以使用--offline脱机工作:

grails --offline run-app

或者通过添加到BuildConfig.groovy

完全禁用它
grails.offline.mode=true 

查看Dependecy Resoultion的文档 - http://grails.org/doc/2.0.4/guide/conf.html#3.7.2%20Dependency%20Repositories

P.S。 Shiro plugin的最新稳定版本为1.1.4,您也可以使用它而不是1.2.0-SNAPSHOT。稳定版只会下载一次。