I notice that, by default, the groovy eclipse plugin sets up an ivy dependency.
This tantalizingly suggests that there’s a way to declare dependencies for a groovy script and resolve them from a repo.
However, the web page at codehaus that describes groovy+ivy is just a page of dead links to a dead domain.
Groovy has a handy @Grab annotation that allows including dependencies dynamically at runtime. It internally uses ivy and can access Ivy/Maven repositories. More information on that can be found here: http://groovy.codehaus.org/Grape
One example from the site:
Another option for ivy integration is at the build level. Gradle the groovy based build system can also include dependencies as part of a build.