Eug
11/17/2025, 12:50 PMGabriel Feo
11/17/2025, 12:51 PMEug
11/18/2025, 12:49 PMEug
11/18/2025, 1:21 PMDevelocity plugin version 4.2.2 is newer than the newest version supported by Develocity 2025.2.1 which is 4.1. Please update to a newer version of Develocity.Eug
11/18/2025, 1:27 PMGabriel Feo
11/18/2025, 2:58 PMdevelocity {
buildScan {
onError { jsonString ->
// fail the build
}
}
}
onError is defined as
/**
* Registers a callback that is invoked when an error occurs capturing, spooling or publishing a build scan.
* <p>
* The callback receives a JSON document describing the error.
*
* @param action the action to execute when an error occurs, with a description of the error
*/
void onError(Action<String> action);
You may try failing the build inside that callback, else if that's not possible, as a best effort, writing to a file and, in the subsequent build, failing if the file exists.
If you also need this behavior in local builds, then you must account for the case of Failed background Build Scan uploads as wellEug
11/20/2025, 7:28 PMEug
11/20/2025, 7:28 PMGabriel Feo
11/20/2025, 7:53 PMbuildScan only exposes our intended public features.
import com.gradle.develocity.agent.gradle.internal.scan.BuildScanConfigurationWithHiddenFeatures
develocity {
(buildScan as BuildScanConfigurationWithHiddenFeatures).apply {
onError {
// ...
}
}
}
You may define a function to prettify it, of course. Then you can use a similar syntax as before from the build scripts.
fun DevelocityConfiguration.buildScanWithHiddenFeatures(
action: BuildScanConfigurationWithHiddenFeatures.() -> Unit,
) {
(buildScan as BuildScanConfigurationWithHiddenFeatures).apply(action)
}Eug
11/20/2025, 10:03 PMEug
11/20/2025, 10:04 PMEug
11/20/2025, 10:04 PMGabriel Feo
11/21/2025, 5:49 PMYou may try failing the build inside that callback, else if that's not possible, as a best effort, writing to a file and, in the subsequent build, failing if the file exists.
If you also need this behavior in local builds, then you must account for the case of Failed background Build Scan uploads as well
Eug
11/21/2025, 6:08 PMEug
11/21/2025, 6:09 PM