The sharedLibrary extension can be used to add additional plugin dependencies, Groovy version dependency, Jenkins Core dependency, etc.
As of right now, most of the workflow-type plugins are automatically added based on default or configured versions.
See the code for full details, but here is an example of what you can configure:
Due to kotlin-dsl/380, you will nee to use the .set methods instead of assignment.
For example, coreVersion.set("2.86") is required.
Limitations/Restrictions
Jenkins Public Default Repository
The repository at https://repo.jenkins-ci.org is added to the repository list to retrieve the Jenkins artifacts.
This decision was made to simplify first use by new consumers.
If you do not wish to use this default, remove the repository after applying the plugin.
Then, you can add your own repository in normal Gradle fashion.
Consuming the Gradle Configurations
There are several configurations that are created to group the different types of Jenkins dependencies used in this plugin.
It is not recommended that you consume/extendsFrom these configurations as they may be changed underneath.
Instead, use the configurations for each source set and make alterations to them (like sourceSets.integrationTest.implementationConfigurationName and sourceSets.integrationTest.runtimeOnlyConfigurationName).
If you have a specific use case please file an issue.
请发表评论