Not sure if this is the right issue but there are probably some things to consider for this issue.
Up until version 0.4 I was able to use @Library like this:
@Library('foo@master')
def util = new foo.Util()
timestamps {
pipeline {
agent docker: 'maven:3-jdk-8'
stages {
stage('Pre-Build') {
util.doSomething()
}
}
notifications {
success {
util.notifyBuildStatusSuccess()
}
...
}
}
Now with 0.4 it fails to find the @Library annotation, I can work around by using the FQN.
But I can't get a single Util instance to work anymore, best I came up with is this:
@org.jenkinsci.plugins.workflow.libs.Library('foo@master')
import foo.Util
pipeline {
agent docker: 'maven:3-jdk-8'
stages {
stage('Pre-Build') {
script {
def util = new Util()
util.doSomething()
}
}
}
notifications {
success {
script {
def util = new Util()
util.notifyBuildStatusSuccess()
}
}
...
}
}
I tried putting the Util in environment but that throws ....sandbox.RejectedAccessException:
@org.jenkinsci.plugins.workflow.libs.Library('foo@master')
import foo.Util
pipeline {
agent docker: 'maven:3-jdk-8'
environment {
util = new Util()
}
stages {
stage('Pre-Build') {
script {
env.util.doSomething()
}
}
}
notifications {
success {
script {
env.util.notifyBuildStatusSuccess()
}
}
...
}
}
Not sure if this is the right issue but there are probably some things to consider for this issue.
Up until version 0.4 I was able to use @Library like this:
Now with 0.4 it fails to find the @Library annotation, I can work around by using the FQN.
But I can't get a single Util instance to work anymore, best I came up with is this:
I tried putting the Util in environment but that throws ....sandbox.RejectedAccessException: