Build Failure On Text
A build failure condition failing build on specific text in a build log.
Example. Fail build if text "ERROR" appears in the build log.
buildType {
// Other Build Type settings ...
failureConditions {
// Other Failure Conditions ...
failOnText {
conditionType = BuildFailureOnText.ConditionType.CONTAINS
pattern = "ERROR"
failureMessage = """Found "ERROR" in the log"""
reverse = false
}
Content copied to clipboard }
}
Example. Fail build if the build log text matches some regexp. Also stops the build as soon as the failure is detected.
buildType {
// Other Build Type settings ...
failureConditions {
// Other Failure Conditions ...
failOnText {
conditionType = BuildFailureOnText.ConditionType.REGEXP
pattern = "#[^#]+EXCEPTION_ACCESS_VIOLATION"
failureMessage = "JVM crash detected"
reverse = false
stopBuildOnFailure = true
}
Content copied to clipboard }
}
See also
Properties
A type defining how to treat the specified pattern
The message to display in the UI and the build log when build fails
Create build problem only on the first match
Immediately stop the build if it fails due to this failure condition
Functions
Copies parameters of this object to the specified target
Creates an instance of this build feature 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.
Validates this object and reports found errors to the provided consumer