Groovy 从Artifactory获取葡萄抓取依赖项

Groovy 从Artifactory获取葡萄抓取依赖项,groovy,grape,Groovy,Grape,我有以下脚本(从Jenkins作业运行),我无法下载依赖项 groovy.grape.report.downloads有些有用,因为它告诉我它试图下载什么。如何让grape告诉我它从哪里下载 我的GrabResolver设置有什么明显的问题吗?我假设这个名字只是一个名字,在其他方面毫无意义 剧本: @GrabResolver(name='artifactory', root='http://artifactory:8081/artifactory/repo1', m2Compatible=tr

我有以下脚本(从Jenkins作业运行),我无法下载依赖项

  • groovy.grape.report.downloads有些有用,因为它告诉我它试图下载什么。如何让grape告诉我它从哪里下载

  • 我的GrabResolver设置有什么明显的问题吗?我假设这个名字只是一个名字,在其他方面毫无意义

  • 剧本:

    @GrabResolver(name='artifactory', root='http://artifactory:8081/artifactory/repo1',  m2Compatible=true)
    @Grapes([
      @Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.7.2'),
      @Grab('net.sf.json-lib:json-lib:2.4')
    ])
    import groovy.text.SimpleTemplateEngine
    import groovyx.net.http.RESTClient
    import net.sf.json.JSON
    
    println "ready?"
    ...
    
    Jenkins控制台的输出:

    [SmartViewer-Trial] $ c:\jenkins\tools\hudson.plugins.groovy.GroovyInstallation\Groovy_2.3.7\groovy-2.3.7\bin\groovy.bat -Dgroovy.grape.report.downloads=true c:\jenkins\workspace\SmartViewer-Trial\hudson4531449279742183970.groovy
    Resolving dependency: net.sf.json-lib#json-lib;2.4 {default=[default]}
    Resolving dependency: org.codehaus.groovy.modules.http-builder#http-builder;0.6 {default=[default]}
    Preparing to download artifact net.sf.json-lib#json-lib;2.4!json-lib.jar
    Preparing to download artifact org.codehaus.groovy.modules.http-builder#http-builder;0.6!http-builder.jar
    Preparing to download artifact commons-beanutils#commons-beanutils;1.8.0!commons-beanutils.jar
    Preparing to download artifact commons-collections#commons-collections;3.2.1!commons-collections.jar
    Preparing to download artifact commons-lang#commons-lang;2.5!commons-lang.jar
    Preparing to download artifact commons-logging#commons-logging;1.1.1!commons-logging.jar
    Preparing to download artifact net.sf.ezmorph#ezmorph;1.0.6!ezmorph.jar
    Preparing to download artifact org.apache.httpcomponents#httpclient;4.2.1!httpclient.jar
    Preparing to download artifact net.sourceforge.nekohtml#nekohtml;1.9.16!nekohtml.jar
    Preparing to download artifact xml-resolver#xml-resolver;1.2!xml-resolver.jar
    Preparing to download artifact org.apache.httpcomponents#httpcore;4.2.1!httpcore.jar
    Preparing to download artifact commons-codec#commons-codec;1.6!commons-codec.jar
    Preparing to download artifact xerces#xercesImpl;2.9.1!xercesImpl.jar
    
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
    General error during conversion: Error grabbing Grapes -- [download failed: net.sf.json-lib#json-lib;2.4!json-lib.jar]
    
    And stacktrace...
    

    它终于开始工作了。我认为这在一定程度上是一个公司代理背后的问题,以及在windows环境中运行和下载的工件最终在网络上运行这一事实,这是由于这里的另一个策略

    @GrabResolver(name='artifactory', root='http://artifactory:8081/artifactory/repo1', m2Compatible=true)
    @Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.6')