Note that there are some explanatory texts on larger screens.

plurals
  1. PODisable automatic download for Groovy grapes
    text
    copied!<p>A sample script ss.groovy:</p> <pre><code>@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.0') import groovyx.net.http.HTTPBuilder println('done') </code></pre> <p>for some reason takes ~25 seconds to load when run with </p> <pre><code>groovy ss.groovy </code></pre> <p>and ~5 seconds when run with </p> <pre><code>groovy -Dgroovy.grape.autoDownload=false ss.groovy </code></pre> <p>as per <a href="https://stackoverflow.com/questions/3371732/how-to-get-groovy-grape-script-startup-going-faster">this StackOverflow explanation</a>. I tried doing manual initialization with</p> <pre><code>Grape.enableAutoDownload = false Grape.grab(group:'org.codehaus.groovy.modules.http-builder', module:'http-builder', version:'0.5.0') import groovyx.net.http.HTTPBuilder println('done') </code></pre> <p>but this fails on import with:</p> <pre><code>/tmp/ss.groovy: 3: unable to resolve class groovyx.net.http.HTTPBuilder @ line 3, column 1. import groovyx.net.http.HTTPBuilder ^ </code></pre> <p>Is there a contained way to either:</p> <ul> <li>Make it not download the artifacts automatically (preferred, as it allows for solving other issues, e.g. external site down while an artifact already exists in the local cache)</li> <li>Make it startup faster in any other way</li> </ul> <p>By contained I mean that all additional instructions should be either within script or, if no such one exists, an acceptable default (e.g. don't check the cached artifacts for updates - I would still, however, like to have automatic downloads globally) to be put in some of groovy config files (e.g. ~/.groovy/grapeConfig.xml or similar).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload