MavenArtifactDependencyTrigger

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"
}




}
}




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"
}









}
}




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")
}
}










}
}




See also

Constructors

Link copied to clipboard
constructor(init: MavenArtifactDependencyTrigger.() -> Unit)
constructor()

Properties

Link copied to clipboard
var artifactId: <Error class: unknown class>

A watched maven artifact id

Link copied to clipboard
var artifactType: <Error class: unknown class>

A type of the watched artifact. By default, the type is "jar".

Link copied to clipboard

Parameters that are added to triggered builds

Link copied to clipboard
var classifier: <Error class: unknown class>

Optional classifier of the watched artifact.

Link copied to clipboard

Specifies whether the trigger is enabled

Link copied to clipboard

Whether the build should be triggered with clean checkout

Link copied to clipboard

When the enforceCleanCheckout is set to true specifies whether the clean checkout should also be applied to all dependencies.

Link copied to clipboard
var groupId: <Error class: unknown class>

A maven group identifier to the watched artifact belongs to

Link copied to clipboard
var id: String?

Trigger id, if not set will be generated

Link copied to clipboard
Link copied to clipboard
var repoId: <Error class: unknown class>

Maven repository ID to match authentication from applied maven settings

Link copied to clipboard
var repoUrl: <Error class: unknown class>

Maven repository URL

Link copied to clipboard
var skipIfRunning: <Error class: unknown class>

Do not trigger a build if currently running builds can produce this artifact

Link copied to clipboard

Trigger type

Link copied to clipboard
var userSettingsPath: <Error class: unknown class>

The path to a user settings file

Link copied to clipboard
var userSettingsSelection: <Error class: unknown class>

Use one of the predefined settings files or provide a custom path. By default, the standard Maven settings file location is used.

Link copied to clipboard
var version: <Error class: unknown class>

Version or Version range

Functions

Link copied to clipboard
fun booleanParameter(customName: String? = null, trueValue: String? = "true", falseValue: String? = "false"): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard

Configures build parameters that are applied to triggered builds

Link copied to clipboard
fun clear()
Link copied to clipboard

Deletes all configured build parameters

Link copied to clipboard
fun <T : CompoundParam<T>> compoundParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun <T : Parametrized> copyParamsTo(target: T): T

Copies parameters of this object to the specified target

Link copied to clipboard
open fun create(): Trigger

Creates an instance of this trigger via reflection using a no argument constructor, used during copying. Throws an error if this class doesn't have a default constructor. Subclasses can override it to create an instance without using a default constructor.

Link copied to clipboard
fun doubleParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun <E : Enum<E>> enumParameter(customName: String? = null, mapping: Map<E, String?>? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun findRawParam(paramName: String): Parameter?
Link copied to clipboard
fun hasParam(paramName: String): Boolean
Link copied to clipboard
fun intParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun param(name: String, value: String)

Adds parameter with specified name and value

Link copied to clipboard
fun removeRawParam(paramName: String)
Link copied to clipboard
open fun stringParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun validate(consumer: ErrorConsumer)

Validates this object and reports found errors to the provided consumer