Here is a tree of a very simple "library" I set up:
├── build.xml
├── manifest.mf
├── nbproject
│ ├── build-impl.xml
│ ├── genfiles.properties
│ ├── groovy-build.xml
│ ├── private
│ │ ├── config.properties
│ │ ├── private.properties
│ │ └── private.xml
│ ├── project.properties
│ └── project.xml
└── src
├── net
│ └── berghold
│ └── MainTest.groovy
└── SimpleGroovyScript.groovy
Most important of which is under "src" with the class MainTest
Here is the class itself:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package net.berghold
/**
*
* @author peter
*/
class MainTest implements Serializable {
def Object context
def void runme(){
context.sh('echo foobar')
}
}
so far nothing earth shattering. I've set up this shared library in the main Jenkins setup menu. Should be groovy so far but it isn't
Here is a simple pipeline I set up to test this:
import net.berghold.MainTest
node('master'){
step('run test'){
def MainTest mt = new MainTest(context: this)
mt.runme()
}
}
When I try to "build" this I get the following error to the console:
Running in Durability level: MAX_SURVIVABILITY
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 1: unable to resolve class net.berghold.MainTest
@ line 1, column 1.
import net.berghold.MainTest
^
1 error
to me that implies the library is not being loaded for reasons I just don't get.
Things I tried:
I actually told it to implicitly load this library but it now complains that it needs a version. I told it "master" and it claims it can't find that version. I tried */master refs/master and a few other things I know exist and the error came back that it could not validate the version with a null pointer error under the details.
Has this functionality been broken?
Running Jenkins 2.147. This all used to work. This example is a pared down version and the original shared libs that worked no longer work and I'm a bit concerned.