I'm running this simply groovy script using groovyConsole (version 1.8.1):
println "Start " + new Date()
@Grab( 'log4j:log4j:1.2.16' )
import org.apache.log4j.Logger
println "End " + new Date()
Usually, it executes very quickly (~ 0 seconds).
However, sometimes (once every ~5 runs), it pauses for 3-5 seconds before completing the run.
I'm sniffing with Wireshark (here is the capture), and see HTTP requests to repository.codehaus.org
(I see some 404 responses in the Wireshark stream, but the script manages to run, so evidently the jars are found at some point)
My question is - once the script runs once, aren't the jars it download via @Grab cached forever? Why is the actual Ivy/Maven repository queried so often?