Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9376

Groovy completely ignores @GrabResolver annotation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0, 2.5.16
    • None
    • None

    Description

      Steps to reproduce inside docker. Repository added using GrabResolver is completely ignored during resolution and fetching.

       

      Manually putting repository location into ~/.groovy/grapeConfig.xml solves the problem and make the custom repository work properly. Tested on Groovy 2.5.x and Groovy 3.x, both have the same issue. This example comes from docker container groovy:3.0.0-rc-3-jre8

       

      root@40bc8b504667:~# rm -rf ~/.ivy ~/.groovy**

      root@40bc8b504667:~# cat example.groovy

      #!/usr/bin/env groovy
      @GrabResolver(name='restlet.org', root='http://maven.restlet.org')
      
      @Grab(group='org.restlet', module='org.restlet', version='1.1.6')
      import org.restlet.Restlet;
      

      root@40bc8b504667:~# groovy -Dgroovy.grape.report.downloads=true -Divy.message.logger.level=4  example.groovy

      setting 'ivy.default.settings.dir' to 'jar:[file:/opt/groovy/lib/ivy-2.5.0.jar!/org/apache/ivy/core/settings'
      setting 'ivy.basedir' to '/root/.'
      setting 'ivy.default.conf.dir' to 'jar:[file:/opt/groovy/lib/ivy-2.5.0.jar!/org/apache/ivy/core/settings'
      setting 'java.runtime.name' to 'OpenJDK Runtime Environment'
      setting 'sun.boot.library.path' to '/opt/java/openjdk/lib/amd64'
      setting 'java.vm.version' to '25.232-b09'
      setting 'groovy.grape.report.downloads' to 'true'
      setting 'java.vm.vendor' to 'AdoptOpenJDK'
      setting 'java.vendor.url' to 'http://java.oracle.com/'
      setting 'path.separator' to ':'
      setting 'java.vm.name' to 'OpenJDK 64-Bit Server VM'
      setting 'file.encoding.pkg' to 'sun.io'
      setting 'user.country' to 'US'setting 'sun.java.launcher' to 'SUN_STANDARD'
      setting 'sun.os.patch.level' to 'unknown'
      setting 'program.name' to 'groovy'
      setting 'java.vm.specification.name' to 'Java Virtual Machine Specification'
      setting 'user.dir' to '/root'
      setting 'java.runtime.version' to '1.8.0_232-b09'
      setting 'java.awt.graphicsenv' to 'sun.awt.X11GraphicsEnvironment'
      setting 'java.endorsed.dirs' to '/opt/java/openjdk/lib/endorsed'
      setting 'os.arch' to 'amd64'
      setting 'java.io.tmpdir' to '/tmp'
      setting 'line.separator' to ''
      setting 'java.vm.specification.vendor' to 'Oracle Corporation'
      setting 'os.name' to 'Linux'
      setting 'tools.jar' to '/opt/java/openjdk/lib/tools.jar'
      setting 'sun.jnu.encoding' to 'UTF-8'
      setting 'script.name' to '/usr/bin/groovy'
      setting 'java.library.path' to '/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib'
      setting 'java.specification.name' to 'Java Platform API Specification'
      setting 'java.class.version' to '52.0'
      setting 'sun.management.compiler' to 'HotSpot 64-Bit Tiered Compilers'
      setting 'os.version' to '5.4.0-3-amd64'
      setting 'user.home' to '/root'
      setting 'user.timezone' to ''
      setting 'java.awt.printerjob' to 'sun.print.PSPrinterJob'
      setting 'file.encoding' to 'UTF-8'
      setting 'java.specification.version' to '1.8'
      setting 'java.class.path' to '/opt/groovy/lib/groovy-3.0.0-rc-3.jar'
      setting 'user.name' to 'root'
      setting 'ivy.message.logger.level' to '4'
      setting 'java.vm.specification.version' to '1.8'
      setting 'sun.java.command' to 'org.codehaus.groovy.tools.GroovyStarter --main groovy.ui.GroovyMain --conf /opt/groovy/conf/groovy-starter.conf --classpath . -Dgroovy.grape.report.downloads=true -Divy.message.logger.level=4 example.groovy'
      setting 'java.home' to '/opt/java/openjdk'
      setting 'sun.arch.data.model' to '64'
      setting 'user.language' to 'en'
      setting 'java.specification.vendor' to 'Oracle Corporation'
      setting 'awt.toolkit' to 'sun.awt.X11.XToolkit'
      setting 'java.vm.info' to 'mixed mode'
      setting 'java.version' to '1.8.0_232'
      setting 'java.ext.dirs' to '/opt/java/openjdk/lib/ext:/usr/java/packages/lib/ext'
      setting 'sun.boot.class.path' to '/opt/java/openjdk/lib/resources.jar:/opt/java/openjdk/lib/rt.jar:/opt/java/openjdk/lib/sunrsasign.jar:/opt/java/openjdk/lib/jsse.jar:/opt/java/openjdk/lib/jce.jar:/opt/java/openjdk/lib/charsets.jar:/opt/java/openjdk/lib/jfr.jar:/opt/java/openjdk/classes'
      setting 'java.vendor' to 'AdoptOpenJDK'
      setting 'file.separator' to '/'
      setting 'groovy.jaxb' to 'jaxb'
      setting 'java.vendor.url.bug' to 'http://bugreport.sun.com/bugreport/'
      setting 'sun.io.unicode.encoding' to 'UnicodeLittle'
      setting 'sun.cpu.endian' to 'little'
      setting 'groovy.starter.conf' to '/opt/groovy/conf/groovy-starter.conf'
      setting 'groovy.home' to '/opt/groovy'
      setting 'sun.cpu.isalist' to ''
      setting 'user.home.url' to 'file:/root/':: loading settings :: url = jar:[file:/opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape/defaultGrapeConfig.xmlsetting|file://opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape/defaultGrapeConfig.xmlsetting] 'ivy.settings.url' to 'jar:[file:/opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape/defaultGrapeConfig.xml'setting|file://opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape/defaultGrapeConfig.xml'setting] 'ivy.conf.url' to 'jar:[file:/opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape/defaultGrapeConfig.xml'setting|file://opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape/defaultGrapeConfig.xml'setting] 'ivy.settings.dir' to 'jar:[file:/opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape'setting|file://opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape'setting] 'ivy.settings.dir.url' to 'jar:[file:/opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape'setting|file://opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape'setting] 'ivy.conf.dir' to 'jar:[file:/opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape'setting|file://opt/groovy/lib/groovy-3.0.0-rc-3.jar!/groovy/grape'setting] 'ivy.default.ivy.user.dir' to '/root/.ivy2'setting 'ivy.home' to '/root/.ivy2'
      no default ivy user dir defined: set to /root/.ivy2
      setting 'ivy.log.modules.in.use' to 'false'
      setting 'ivy.resolver.default.check.modified' to 'false'
      setting 'ivy.default.always.check.exact.revision' to 'false'
      setting 'ivy.retrieve.pattern' to '${ivy.lib.dir}/[artifact]-[revision](-[classifier]).[ext]'
      setting 'ivy.configurations' to '*'
      setting 'ivy.buildlist.ivyfilepath' to 'ivy.xml'
      setting 'ivy.status' to 'integration'
      setting 'ivy.resolve.default.type.filter' to '*'
      setting 'ivy.project.dir' to '${basedir}'
      setting 'ivy.dep.file' to 'ivy.xml'
      setting 'ivy.settings.file' to 'ivysettings.xml'
      setting 'ivy.report.output.pattern' to '[organisation]-[module]-[conf].[ext]'
      setting 'ivy.cache.ttl.default' to '10s'
      setting 'ivy.publish.src.artifacts.pattern' to '${ivy.distrib.dir}/[type]s/[artifact]-[revision](-[classifier]).[ext]'
      setting 'ivy.deliver.ivy.pattern' to '${ivy.distrib.dir}/[type]s/[artifact]-[revision](-[classifier]).[ext]'
      setting 'ivy.build.artifacts.dir' to '${ivy.project.dir}/build/artifacts'
      setting 'ivy.checksums' to 'sha1,md5'
      setting 'ivy.distrib.dir' to '${ivy.project.dir}/distrib'
      setting 'ivy.lib.dir' to '${ivy.project.dir}/lib'
      setting 'ivy.cache.dir' to '/root/.ivy2/cache'
      no default cache defined: set to /root/.ivy2/cachedownloadGrapes:
      no namespace defined: using systemdownloadGrapes:
      no latest strategy defined: using defaultjcenter:
      no namespace defined: using systemjcenter:
      no latest strategy defined: using defaultcachedGrapes:
      no namespace defined: using systemcachedGrapes:
      no latest strategy defined: using defaultlocalm2:
      no namespace defined: using systemlocalm2:
      no latest strategy defined: using defaultibiblio:
      no namespace defined: using systemibiblio:
      no latest strategy defined: using default'ivy.default.ivy.user.dir' already set: discarding '/root/.ivy2'settings loaded (175ms)
      default cache: /root/.ivy2/
      cache default resolver: downloadGrapes
      default latest strategy: latest-revision
      default conflict manager: latest-revision
      circular dependency strategy: warn
      validate: true
      check up2date: true
      – 5 resolvers: downloadGrapes [chain] [cachedGrapes, localm2, jcenter, ibiblio] return first: true dual: false -> cachedGrapes -> localm2 -> jcenter -> ibiblio jcenter [ibiblio] cache: null m2compatible: true ivy patterns: [https://jcenter.bintray.com/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]]
      artifact patterns: [https://jcenter.bintray.com/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]]
      repository: jcenter
        root: [https://jcenter.bintray.com/]
        pattern: [organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]
        usepoms: true
        useMavenMetadata: true
        cachedGrapes [file]
        cache: null
        m2compatible: false
        ivy patterns: /root/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml
        artifact patterns: /root/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]
      repository: cachedGrapes localm2 [ibiblio]
        cache: null
        m2compatible: true
        ivy patterns: [file:/root//.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext|file://root//.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]]
        artifact patterns: [file:/root//.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext|file://root//.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]]
      repository: localm2
        root: [file:/root//.m2/repository/|file://root//.m2/repository/]
        pattern: [organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]
        usepoms: true
        useMavenMetadata: true
        ibiblio [ibiblio]
        cache: null
        m2compatible: true
        ivy patterns: [https://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]]
        artifact patterns: [https://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]]
      repository: ibiblio
        root: [https://repo1.maven.org/maven2/]
        pattern: [organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]
        usepoms: true
        useMavenMetadata: true
        module settings: NONE'ivy.cache.dir' already set: discarding '/root/.groovy/grapes'
      setting 'ivy.default.configuration.m2compatible' to 'true'
      Resolving dependency: org.restlet#org.restlet;1.1.6 {default=[default]}:: resolving dependencies :: caller#all-caller;working26 confs: [default] validate = false refresh = false
      resolving dependencies for configuration 'default'== resolving dependencies for caller#all-caller;working26 [default]loadData of caller#all-caller;working26 of rootConf=default== resolving dependencies caller#all-caller;working26->org.restlet#org.restlet;1.1.6 [default->default]loadData of org.restlet#org.restlet;1.1.6 of rootConf=default using downloadGrapes to resolve org.restlet#org.restlet;1.1.6downloadGrapes:
      Checking cache for: dependency: org.restlet#org.restlet;1.1.6 {default=[default]} no ivy file in cache for org.restlet#org.restlet;1.1.6: tried /root/.groovy/grapes/org.restlet/org.restlet/ivy-1.1.6.xml no ivy file in cache for org.restlet#org.restlet;1.1.6: tried /root/.groovy/grapes/org.restlet/org.restlet/ivy-1.1.6.xml trying /root/.groovy/grapes/org.restlet/org.restlet/ivy-1.1.6.xml tried /root/.groovy/grapes/org.restlet/org.restlet/ivy-1.1.6.xml
      cachedGrapes: resource not reachable for org.restlet#org.restlet;1.1.6: res=/root/.groovy/grapes/org.restlet/org.restlet/ivy-1.1.6.xml trying /root/.groovy/grapes/org.restlet/org.restlet/jars/org.restlet-1.1.6.jar tried /root/.groovy/grapes/org.restlet/org.restlet/jars/org.restlet-1.1.6.jar
      cachedGrapes: resource not reachable for org.restlet#org.restlet;1.1.6: res=/root/.groovy/grapes/org.restlet/org.restlet/jars/org.restlet-1.1.6.jar
      cachedGrapes: no ivy file nor artifact found for org.restlet#org.restlet;1.1.6
      don't use cache for org.restlet#org.restlet;1.1.6: checkModified=true trying [file:/root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.pom|file://root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.pom] tried [file:/root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.pom|file://root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.pom]
      localm2: resource not reachable for org/restlet#org.restlet;1.1.6: res=[file:/root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.pom|file://root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.pom] trying [file:/root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.jar|file://root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.jar] tried [file:/root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.jar|file://root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.jar]
      localm2: resource not reachable for org/restlet#org.restlet;1.1.6: res=[file:/root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.jar|file://root//.m2/repository/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.jar]
      localm2: no ivy file nor artifact found for org.restlet#org.restlet;1.1.6 no ivy file in cache for org.restlet#org.restlet;1.1.6: tried /root/.groovy/grapes/org.restlet/org.restlet/ivy-1.1.6.xml trying [https://jcenter.bintray.com/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.pom] tried [https://jcenter.bintray.com/org/restlet/org.restlet/1.1.6/org.restlet-1.1.6.pom]
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              szubersk Damian Szuberski
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h