I have code similar to the one below in my Jenkinsfile:
node { checkout scm // do some stuff try { // do some maven magic } catch (error) {
This happens when an additional exception is thrown inside the finally block or before the re-throw inside catch. In these cases the RejectedAccessException is swallowed and script-security does not catch it.
finally
catch
RejectedAccessException
script-security