我声明了以下groovy依赖:
@GrabResolver(name='mymirror', root='http://myartifactory/public/')
@Grab(group='groupid', module='artifactid', version='1.2.3')
println //What should I write here to see: c:\Users....m2....artifactid.jar
如何在groovy中获取下载的已解决工件的位置?
答案 0 :(得分:2)
@Grab(group='net.sourceforge.plantuml', module='plantuml', version='8049')
import groovy.grape.Grape
def grape = Grape.getInstance()
def r = grape.listDependencies(this.getClass().getClassLoader())
println r
println grape.resolve(r[0])
打印
[[group:net.sourceforge.plantuml, module:plantuml, version:8049]]
[file:/C:/Users/dm/.groovy/grapes/net.sourceforge.plantuml/plantuml/jars/plantuml-8049.jar]
答案 1 :(得分:1)