Plugin Library Provider
We have created a sample repository you can use to get started when packaging your libraries as a plugin.
When developing a library providing plugin, it can shorten the feedback loop during development to configure an SCM Library that is configured to load from the plugin’s source code repository with a base directory of
Once updates have been validated, the libraries can then be built into a plugin for distribution.
It’s a lot less work to configure a source code repository and configure it as a library source. So why would someone want to spend the time packaging their libraries as a Jenkins Plugin?
Steps contributed by libraries often rely on particular Jenkins plugins in their implementation. Packing libraries as a Jenkins Plugin ensures that all other plugin dependencies (and their versions) are satisfied when installing the library providing plugin.
It slows down library loading to reach out to a remote source code repository to retrieve libraries. When packaged as a plugin, JTE no longer needs to fetch libraries from the remote repository.
It can be helpful to ensure that specific version of the Templating Engine Plugin is installed if the interface between JTE and libraries changes.
One specific use-case for the Templating Engine Plugin is for DevOps engineers supporting multiple pipelines simultaneously. In these situations, the libraries provided are likely shared across the teams as well. Over time, libraries can be changed in a way that breaks backwards compatibility. Packaging libraries as a plugin allows you to version your set of libraries as an artifact where teams can upgrade when it makes the most operational sense.