The following line (128) in PluginLibraryProvider.groovy checks if a library directory is valid. It does so by inspecting the presence of steps/ and src/ directories within the library. However, it would seem that there is a bug introduced by employing the || operator instead of the && operator.
By using the || operator, both steps and classes are required. If && was employed, then a library implementing only steps or classes would be considered valid.
Given the plugin example presented here & other library development practices, it would appear that && is the desired behavior.
My present workaround is to include dummy content within the library directory, which is not an ideal solution to carry forward.
i.e.
### This works
libraries/
exampleLibrary/
steps/
exampleStep.groovy
src/
foo.groovy
### This does not
libraries/
exampleLibrary/
steps/
exampleStep.groovy
Thanks :)
Relevant log output
17:04:07 Started by user unknown or anonymous
17:04:07 [2022-04-27T00:04:07.857Z] [JTE] Pipeline Configuration Modifications
17:04:07 [JTE] Configurations Added:
17:04:07 [JTE] - libraries.libraryA set to [:]
17:04:07 [JTE] Configurations Deleted: None
17:04:07 [JTE] Configurations Changed: None
17:04:07 [JTE] Configurations Duplicated: None
17:04:07 [JTE] Configurations Ignored: None
17:04:07 [JTE] Subsequent May Merge: None
17:04:07 [JTE] Subsequent May Override: None
17:04:08 [JTE] Library libraryA exists but does not have any steps or classes. Will not be loaded.
17:04:08 [2022-04-27T00:04:08.079Z] [JTE] The following errors occurred:
17:04:08 [JTE] 1: Library libraryA not found.
Steps to Reproduce
Create a new plugin by cloning the following repository
Build & install the plugin
Configure a job to use the new library. For simplicity, ignore other pipeline configurations & include a similar Jenkinsfile
Jenkins Version
Jenkins 2.289.1
JTE Version
2.3
Bug Description
The following line (128) in PluginLibraryProvider.groovy checks if a library directory is valid. It does so by inspecting the presence of
steps/
andsrc/
directories within the library. However, it would seem that there is a bug introduced by employing the||
operator instead of the&&
operator.By using the
||
operator, both steps and classes are required. If&&
was employed, then a library implementing only steps or classes would be considered valid.Given the plugin example presented here & other library development practices, it would appear that
&&
is the desired behavior.My present workaround is to include dummy content within the library directory, which is not an ideal solution to carry forward.
i.e.
Thanks :)
Relevant log output
Steps to Reproduce
and pipeline configuration