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

active choices reactive parameter cant load shared library

      In groovy script in parameter i havent access into Groovy shared library.

      I use version 1.5.3 of Active Choices Plugin.

      In job workflow works same include.

          [JENKINS-46394] active choices reactive parameter cant load shared library

          Tomas Pavelka created issue -
          Ioannis Moutsatsos made changes -
          Attachment New: image-2017-12-01-10-47-13-884.png [ 40558 ]

          Ioannis Moutsatsos added a comment - - edited

          Have you tried using the grapes Groovy dependency management?

          Then in your Active Choices script you can use the @Grab annotation.

          In one of my script I'm using the Http-Builder-ng library for web service calls. In that case the Active Choices script @Grab annotation looks like this.

          Ioannis Moutsatsos added a comment - - edited Have you tried using the grapes Groovy dependency management? Then in your Active Choices script you can use the @Grab annotation. In one of my script I'm using the Http-Builder-ng library for web service calls. In that case the Active Choices script @Grab annotation looks like this.

          Sounds like a good workaround.

          Tried after following instructions from this post https://tcollignon.github.io/2017/07/10/How-To-Use-third-party-libraries-in-Jenkins-Pipeline.html (TL;DR had to install Pipeline Shared Groovy Libraries Plugin).

          Let's leave it open for a while to wait for user comments. Otherwise mark as won't fix in favour of the workaround in the next issue triaging.

          Bruno P. Kinoshita added a comment - Sounds like a good workaround. Tried after following instructions from this post https://tcollignon.github.io/2017/07/10/How-To-Use-third-party-libraries-in-Jenkins-Pipeline.html (TL;DR had to install Pipeline Shared Groovy Libraries Plugin). Let's leave it open for a while to wait for user comments. Otherwise mark as won't fix in favour of the workaround in the next issue triaging.
          Andrew Bayer made changes -
          Component/s Original: workflow-cps-global-lib-plugin [ 21714 ]

          I think that the possibility to centralize common function in a shared library it's more robust than insert code in each pipeline/job instead.

          Michele Vanini added a comment - I think that the possibility to centralize common function in a shared library it's more robust than insert code in each pipeline/job instead.

          I Don't think this is a suitable solution for Tomas. He probably wanted to be able to load the "Global Pipeline Libraries" from the "Groovy Script" box in the Active Choices Parameter.

          (paveto: correct me if im wrong)

          Samuel Archambault added a comment - I Don't think this is a suitable solution for Tomas. He probably wanted to be able to load the " Global Pipeline Libraries " from the "Groovy Script" box in the Active Choices Parameter. ( paveto : correct me if im wrong)

          I would prefer to use scripts from Global Pipeline Libraries instead of @Grab or Scriptler

          Viktor Bogdanov added a comment - I would prefer to use scripts from  Global Pipeline Libraries  instead of @Grab or Scriptler

          Ingmar Karge added a comment -

          I think the workaround is too inconvenient to use. I want to include my own library (which I already use in the jenkins pipeline) and not an external lib.

          Ingmar Karge added a comment - I think the workaround is too inconvenient to use. I want to include my own library (which I already use in the jenkins pipeline) and not an external lib.

          Ashwin Pai added a comment -

          I too would vote in favour of this feature. It would be very useful to have a single shared groovy lib that can be used across. 

          Ashwin Pai added a comment - I too would vote in favour of this feature. It would be very useful to have a single shared groovy lib that can be used across. 

            kinow Bruno P. Kinoshita
            paveto Tomas Pavelka
            Votes:
            37 Vote for this issue
            Watchers:
            45 Start watching this issue

              Created:
              Updated: