diff --git a/.mvn/gradle-enterprise-custom-user-data.groovy b/.mvn/gradle-enterprise-custom-user-data.groovy
index 5bafebd472425..df89bae95ffee 100644
--- a/.mvn/gradle-enterprise-custom-user-data.groovy
+++ b/.mvn/gradle-enterprise-custom-user-data.groovy
@@ -1,4 +1,16 @@
+// Configure build scan publication
+boolean publish = true
+if(session?.getRequest()?.getBaseDirectory() != null) {
+ def testBuildPaths = [ '/target/codestart-test/', '/target/it/', '/target/test-classes/', '/target/test-project/']
+ publish = testBuildPaths.every {testBuildPath -> !session.getRequest().getBaseDirectory().contains(testBuildPath) }
+ if(!publish) {
+ // do not publish a build scan for test builds
+ log.debug("Disabling build scan publication for " + session.getRequest().getBaseDirectory())
+ }
+}
+buildScan.publishAlwaysIf(publish)
+buildScan.publishIfAuthenticated()
// Add mvn command line
def mvnCommand = ''
diff --git a/.mvn/gradle-enterprise.xml b/.mvn/gradle-enterprise.xml
index 9918eb0810d62..f0f8f8d497fd5 100644
--- a/.mvn/gradle-enterprise.xml
+++ b/.mvn/gradle-enterprise.xml
@@ -5,15 +5,12 @@
-
- #{basedir.contains('test-classes') ? 'ON_FAILURE' : 'ALWAYS'}
-
-
- #{basedir.contains('test-classes') ? 'TEST-BUILD' : 'MAIN-BUILD'}
-
+
#{{'0.0.0.0'}}
@@ -23,7 +20,6 @@
#{env['CI'] == null}
- true
false