【发布时间】:2010-07-30 13:13:24
【问题描述】:
我注意到在我的 OSX 机器上使用带有 Grape 注释的 groovy 脚本会有 10 秒的点击量。总是这样吗?我可以让葡萄有利于它的缓存吗(依赖关系肯定已经在系统中~/.groovy/grapes...)。
【问题讨论】:
标签: groovy groovy-grape
我注意到在我的 OSX 机器上使用带有 Grape 注释的 groovy 脚本会有 10 秒的点击量。总是这样吗?我可以让葡萄有利于它的缓存吗(依赖关系肯定已经在系统中~/.groovy/grapes...)。
【问题讨论】:
标签: groovy groovy-grape
一些库(尤其是 httpbuilder)在其依赖项中使用版本范围。有一个帖子here 描述了如何在您的grapeconfig.xml 文件中增加此版本检查的TTL。
【讨论】:
您是否定义了 ~/.groovy/grapeConfig.xml 文件? doco 中给出的示例支持本地缓存。
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<chain name="downloadGrapes">
<filesystem name="cachedGrapes">
<ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
<artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
</filesystem>
<!-- todo add 'endorsed groovy extensions' resolver here -->
<ibiblio name="codehaus" root="http://repository.codehaus.org/" m2compatible="true"/>
<ibiblio name="ibiblio" m2compatible="true"/>
<ibiblio name="java.net2" root="http://download.java.net/maven/2/" m2compatible="true"/>
</chain>
</resolvers>
</ivysettings>
【讨论】: