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

Cannot use java.util.regex.Matcher class when workflow script is sandboxed

      Using this in a workflow script

      def fileText = readFile('dist/index.html')
      fileText = (fileText =~ /baseUrl.('.')/).replaceFirst("baseUrl: 'XXXX'")

      throws this:

      org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method java.util.regex.Matcher replaceFirst java.lang.String

          [JENKINS-30520] Cannot use java.util.regex.Matcher class when workflow script is sandboxed

          Dominik Bartholdi created issue -
          Jesse Glick made changes -
          Link New: This issue duplicates JENKINS-25804 [ JENKINS-25804 ]
          Jesse Glick made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 165631 ] New: JNJira + In-Review [ 197772 ]

            jglick Jesse Glick
            domi Dominik Bartholdi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: