Shared Library Extension
Extension for the com.mkobit.jenkins.pipelines.shared-library plugin.
All properties have sensible defaults (see SharedLibraryDefaults) and are optional.
sharedLibrary {
jenkins {
version = "2.492.3"
bomVersion = "3463.v23b_7bb_b_b_66d5"
}
pipelineUnitVersion = "1.29"
autoRegisterLibrary = true
implicit = true
plugins {
plugin("org.jenkins-ci.plugins.workflow:workflow-multibranch")
}
}The built-in integrationTest suite is wired automatically. Additional suites opt in by setting JenkinsTestSuiteExtension.useTestHarness to true on the suite's extension:
testing {
suites {
register<JvmTestSuite>("integrationTestKotest") {
jenkins.useTestHarness = true
}
}
}Constructors
Properties
When true (default), generates SharedLibraryAutoRegistrar.java and registers the SezPoz annotation processor so Jenkins auto-registers the shared library at embedded Jenkins startup. No explicit GlobalLibraries.get().setLibraries(...) call is needed in test code.
Peer shared library dependencies declared via dependencies.
Name of the shared library injected into the embedded Jenkins test instance. Defaults to project.name.
Maximum number of Jenkins test suites that may execute concurrently within this project. Controls the JenkinsTestSuiteService build-service slot shared by all suites wired via JenkinsTestSuiteExtension.useTestHarness. Defaults to 1 (safe on any machine); increase on hosts with more RAM — allow roughly 4 GiB per additional parallel slot.
com.lesfurets:jenkins-pipeline-unit version used in the test suite.
Jenkins HPI/JPI plugin dependencies declared via plugins.
Functions
Declares peer shared library dependencies — other shared libraries this project depends on. Each peer is registered with the embedded Jenkins as a Global Library.
Configures the Jenkins core and test-harness versions.
Declares Jenkins HPI/JPI plugin dependencies.
Opts suite into full Jenkins test-harness wiring.