-
Type:
Bug
-
Resolution: Not A Defect
-
Priority:
Minor
-
Component/s: workflow-cps-global-lib-plugin
-
Environment:Jenkins ver 2.46.3
Pipeline: Shared Groovy Libraries ver 2.8
Hi there,
I love the idea of using shared libraries! I've been trying to use it - quite successfully - until I started using resources.
I have a directory layout similar to the one described in the documentation.
Inside my library I have a class rendering an html template (would be Bar.groovy). This template is in the resource directory (would be bar.json).
Unfortunately, I just can't manage to retrieve the path of the resource using:
this.class.getResource("org/foo/bar.json")
This always returns "null" when executed on a Jenkins server while it does return the correct file path when running locally on my machine.
Â
However, the following works like a charm:
def request = libraryResource 'org/foo/bar.json'
Â
Is this a bug or am I doing something wrong? Any help much appreciated ![]()