如何使用登录凭据丰富 "GrabResolver"

How to enrich "GrabResolver" with Login Credentials

我正在尝试使用 Groovy 的 "GrabResolver" 注释和以下语句从我们的内部 Nexus OSS Maven 存储库中检索一个 Artefact:

@GrabResolver(name = 'bla', root = 'http://x.x.x.x:8081/repository/bla/', m2Compatible = 'true')
....
groovy.grape.Grape.grab(group: '...', module: '...', version: '...', ext: '...')

现在我面临的问题是我们的 Nexus 受到登录凭据的保护,并且不会显示匿名访问的人工制品。

是否可以将登录凭据传递给 GrabResolver 调用?

无法从注释中添加凭据。你可以customize your Ivy settings to do it for you. Add your credentials到~/.groovy/grapeConfig.xml