Peter Berghold
2018-10-16 19:48:42 UTC
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.
âââ 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.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAArvnv3tBnk9B3Xm4Z2vug%2BNCv92822k5H70xRm_%3D-DW7jdhKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAArvnv3tBnk9B3Xm4Z2vug%2BNCv92822k5H70xRm_%3D-DW7jdhKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.