Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53012

Unable to configure grapeConfig or Ivy config for declarative pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins ver. 2.107.2, Pipeline 2.5, Pipeline Groovy 2.4.9, Windows 10 x64

      I am attempting to execute some code (an API client wrapper) in a declarative pipeline, within a script block which relies on a jar library in our private artifact repository (Artifactory).  I am able to use @Grab to pull libs from the public maven repository, but cannot get Jenkins to pick up a custom config containing my Artifactory instance in order to resolve our private library set.  I've tried several combinations of grapeConfig.xml and ivysettings.xml in different locations, but cannot seem to override the default config that is picked up via the plugin jar files.

      If this is supported, it's documented very poorly.  If it's not supported, I'd like to request support be added given this should be a typical use case.  If this cannot be done directly in the pipeline is it possible via the shared library functionality?  Documentation there also seems very poor on the subject - all examples are trivial and make no mention of importing 3rd party dependencies or configuring dependency resolution.

      I've attempted to add the following JVM system properties, without much luck:

      -Dgroovy.grape.report.downloads=true
      -Divy.message.logger.level=4
      -Dgrape.config=%USERPROFILE%\.groovy\grapeConfig.xml
      -Dgrape.root=%USERPROFILE%\.groovy
      -Divy.default.settings.dir=%USERPROFILE%\.ivy2
      -Divy.default.conf.dir=%USERPROFILE%\.ivy2

       

      I can tell from the log files that it's not picking up my custom grape/ivy config and that it's not even attempting to resolve from my Artifactory installation.

            Unassigned Unassigned
            mrokitka Mike Rokitka
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: