Maven Artifact Dependency Trigger
A trigger running builds when there is a modification of the maven dependency content.
Example. Adds a simple Maven Artifact Dependency Trigger for given atrifact the latest snapshot version with default Maven settings.
buildType {
// Other Build Type settings ...
triggers {
// Other Triggers ...
mavenArtifact {
groupId = "org.example.group"
artifactId = "example-atrifact"
version = "1.0-SNAPSHOT"
userSettingsSelection = "userSettingsSelection:default"
}
Content copied to clipboard }
}
Example. Adds a Maven Artifact Dependency Trigger for given atrifact with specified version range, custom classifier, Maven repository and user settings. This trigger will not trigger a build if currently running builds can produce this artifact.
buildType {
// Other Build Type settings ...
triggers {
// Other Triggers ...
mavenArtifact {
groupId = "org.example.group"
artifactId = "example-atrifact"
version = "[1.0,2.0)"
classifier = "sources"
repoUrl = "https://mypackages.org/maven/"
repoId = "my-repo-id"
skipIfRunning = true
userSettingsSelection = "userSettingsSelection:byPath"
userSettingsPath = "path/to/user/settings.xml"
}
Content copied to clipboard }
}
Example. Adds a simple Maven Artifact Dependency Trigger for given atrifact the latest snapshot version with Maven settings provided on project level. Enables build customization which deletes all the files from the checkout directory for the triggered build and its dependencies and also adds a new parameter to the triggered build with the dependency parameter reference.
buildType {
// Other Build Type settings ...
triggers {
// Other Triggers ...
mavenArtifact {
groupId = "org.example.group"
artifactId = "example-atrifact"
version = "1.0-SNAPSHOT"
userSettingsSelection = "settings.xml"
enforceCleanCheckout = true
enforceCleanCheckoutForDependencies = true
buildParams {
param("triggered.version", "dep.Project_BuildID.version")
}
}
Content copied to clipboard }
}
See also
Properties
A watched maven artifact id
A type of the watched artifact. By default, the type is "jar".
Parameters that are added to triggered builds
Optional classifier of the watched artifact.
Whether the build should be triggered with clean checkout
When the enforceCleanCheckout is set to true specifies whether the clean checkout should also be applied to all dependencies.
Do not trigger a build if currently running builds can produce this artifact
The path to a user settings file
Use one of the predefined settings files or provide a custom path. By default, the standard Maven settings file location is used.
Functions
Configures build parameters that are applied to triggered builds
Deletes all configured build parameters
Copies parameters of this object to the specified target
Validates this object and reports found errors to the provided consumer