Sample script ss.groovy:
@Grab(group='org.codehaus.groovy.modules.http-builder',
module='http-builder',
version='0.5.0')
import groovyx.net.http.HTTPBuilder
println('done')
for some reason, it takes ~ 25 seconds to load when starting from
groovy ss.groovy
and ~ 5 seconds when starting with
groovy -Dgroovy.grape.autoDownload=false ss.groovy
according qaru.site/questions/1762997 / ... . I tried to perform manual initialization with
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')
but this fails when importing with:
/tmp/ss.groovy: 3: unable to resolve class groovyx.net.http.HTTPBuilder
@ line 3, column 1.
import groovyx.net.http.HTTPBuilder
^
Is there an affordable way:
- Do not download artifacts automatically (preferable, since this allows you to solve other problems, for example, an external site down while the artifact already exists in the local cache)
- Make launch faster any other way.
, script, , , (, ). , ), groovy (, ~/.groovy/grapeConfig.xml ).