Shared Library Dependencies
Dependency block for declaring peer Jenkins shared library dependencies inside sharedLibrary {}.
Each declared peer is registered with the embedded Jenkins as a Global Library, the same way an administrator would configure it under Manage Jenkins → Global Pipeline Libraries.
project(":path") works for subprojects in the same Gradle build.
GAV notation ("g:a:v") works when Gradle substitutes the coordinate with a local project — i.e. the peer is declared via includeBuild(...) in settings.gradle.kts. Resolution from a remote Maven repository is not supported yet; see issue #165.
sharedLibrary {
dependencies {
sharedLibrary(project(":config-lib")) // subproject
sharedLibrary("com.example:config-lib:1.0.0") // composite build (includeBuild)
sharedLibrary(project(":config-lib")) {
libraryName = "config" // override the Jenkins library name
implicit = false // require @Library('config') _ in pipelines
}
}
}Properties
Feeds the sharedLibraryDependencies bucket configuration used for classpath wiring.
Per-declaration metadata used at integration-test injection time to assign Jenkins library names (default: artifact / project name) and the implicit flag (default: true).
Functions
Declares a peer shared library by "group:artifact:version" notation.
Declares a peer shared library from another project in this build (multi-project or composite).
Declares a peer shared library from a version catalog entry.
Declares a peer shared library by GAV notation and applies per-library overrides.
Declares a peer shared library from another project and applies per-library overrides.
Declares a peer shared library from a version catalog entry and applies per-library overrides.