• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • scriptler-plugin
    • None

      Dominik:

      currently, "scriptler" uses either jenkins classloader or TCCL;
      https://github.com/jenkinsci/scriptler-plugin

      do you think it would be feasible for "scriptler" also to support explicit classpath?

      say, similar to how "dynamicparameter" plugin is doing this now:
      https://github.com/Seitenbau/sb-jenkins-dynamicparameter

      namely:
      https://github.com/jenkinsci/dynamicparameter-plugin/blob/master/src/main/java/com/seitenbau/jenkins/plugins/dynamicparameter/util/JenkinsUtils.java#L97

      1) provide capability to define "jar folder" location on jenkins
      2) replicate this folder to all jenkins slaves
      3) add these folders to the GroovyShell classpath

      finally, since
      "dynamicparameter" depends on "scriptler", you could probably
      agree with authors of "dynamicparameter" to move this functionality
      into the "scriptler" and make it a shared feature for all groovy script plugins?

      thank you;

      Andrei.

          [JENKINS-15878] scriptler explicit classpath

          panticz added a comment -

          as workarround you can put your jar file to default java classpath dir:

          /usr/java/packages/lib/ext/

          see:
          http://stackoverflow.com/questions/26614316/connector-j-mysql-driver-in-jenkins-script-console-scriptler

          panticz added a comment - as workarround you can put your jar file to default java classpath dir: /usr/java/packages/lib/ext/ see: http://stackoverflow.com/questions/26614316/connector-j-mysql-driver-in-jenkins-script-console-scriptler

          Hi. I'm writing a post on how to use ImageJ with Jenkins and active-choies plug-in. That plug-in relies on Scriptler for managed scripts. So will try to submit a pull request for it in the next days. Will take a look at the Groovy invoke action in the core, and in the dynamic parameter implementation too. But if anyone has any suggestions for the implementation, happy to discuss

          As for security, if I remember correctly the script-security plug-in has a white or black list of classes and methods allowed. So adding new classes to the classloader won't be an issue, as the user that is using that plug-in will need to approve the methods and classes anyway.

          Bruno P. Kinoshita added a comment - Hi. I'm writing a post on how to use ImageJ with Jenkins and active-choies plug-in. That plug-in relies on Scriptler for managed scripts. So will try to submit a pull request for it in the next days. Will take a look at the Groovy invoke action in the core, and in the dynamic parameter implementation too. But if anyone has any suggestions for the implementation, happy to discuss As for security, if I remember correctly the script-security plug-in has a white or black list of classes and methods allowed. So adding new classes to the classloader won't be an issue, as the user that is using that plug-in will need to approve the methods and classes anyway.

          I would think in direction of @Grape as its supported by pipeline: https://jenkins.io/doc/book/pipeline/shared-libraries/#using-third-party-libraries

          Dominik Bartholdi added a comment - I would think in direction of @Grape as its supported by pipeline:  https://jenkins.io/doc/book/pipeline/shared-libraries/#using-third-party-libraries

          +1 I wonder if users can use Grape with a local JAR too. That way users without a Mven repo could use Grape anyway. Will try to create a pull request in that direction domi.

          Thanks!

          Bruno P. Kinoshita added a comment - +1 I wonder if users can use Grape with a local JAR too. That way users without a Mven repo could use Grape anyway. Will try to create a pull request in that direction domi . Thanks!

            domi Dominik Bartholdi
            andrei_pozolotin Andrei Pozolotin
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: