Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道您可以@GrabResolver(name='restlet', root='http://maven.restlet.org/')在 groovy 文件的开头使用。但是,我希望能够在我使用 groovysh 时进行此调用。
@GrabResolver(name='restlet', root='http://maven.restlet.org/')
有没有办法做到这一点?
groovy:000> import groovy.grape.Grape ===> [import groovy.grape.Grape] groovy:000> Grape.addResolver(name:'restlet', root:'http://maven.restlet.org/') ===> null
@GrabResolver内部在使用注解的类中添加上述调用 ( Grape.addResolver())。默认情况下,此行为由initClass注释中设置为 true 的属性驱动。
@GrabResolver
Grape.addResolver()
initClass