문제

I know that you can use @GrabResolver(name='restlet', root='http://maven.restlet.org/') at the start of a groovy file. However, I wish to be able to do this call whilst I am in the groovysh.

is there a way to do this?

도움이 되었습니까?

해결책

groovy:000> import groovy.grape.Grape
===> [import groovy.grape.Grape]
groovy:000> Grape.addResolver(name:'restlet', root:'http://maven.restlet.org/')
===> null

@GrabResolver internally adds the above call (Grape.addResolver()) in the class where the annotation is used. By default this behaviour is driven by the initClass property being set to true in the annotation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top