dsummersl
dsummersl

Reputation: 6727

How to get groovy grape script startup going faster

I've noticed there is like a 10 second hit using a groovy script with Grape annotations on my OSX box. Is it always this way? Can I make grape favor its cache (the depedencies are definitely already on the system in ~/.groovy/grapes...).

Upvotes: 0

Views: 1044

Answers (2)

mmigdol
mmigdol

Reputation: 2193

Some libraries (notably httpbuilder) use version ranges in their dependencies. There is a post here which describes how to increase the TTL for this version check in your grapeconfig.xml file.

Upvotes: 2

Mark O'Connor
Mark O'Connor

Reputation: 77971

Do you have a ~/.groovy/grapeConfig.xml file defined? The example given in the doco favours the local cache.

<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>

Upvotes: 1

Related Questions