You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2026/09/29 11:46:29 UTC

(maven-enforcer) branch master updated: Match both log levels in the BUILD FAILURE IT assertions

This is an automated email from the ASF dual-hosted git repository.

slawekjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git


The following commit(s) were added to refs/heads/master by this push:
     new 1f55ad39 Match both log levels in the BUILD FAILURE IT assertions
1f55ad39 is described below

commit 1f55ad396c83b141d89b708f7c8e2bf2a2f77372
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Tue Sep 29 12:50:01 2026 +0200

    Match both log levels in the BUILD FAILURE IT assertions
    
    Maven 4.0.0-rc-7 and 3.10.0 log the build result summary at ERROR level,
    so the line reads [ERROR] BUILD FAILURE. The three ITs that assert the
    [INFO] prefix therefore fail on those versions. Match either prefix, so
    the ITs pass on Maven 3.9.x and on 4.x alike.
    
    Co-Authored-By: Claude Opus 5 (1M context) <no...@anthropic.com>
---
 .../ban-distribution-management-multi-module-build/verify.groovy        | 2 +-
 .../src/it/projects/require-same-versions_failure/verify.groovy         | 2 +-
 .../it/projects/require-same-versions_multi-module-build/verify.groovy  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/verify.groovy b/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/verify.groovy
index 331c97bf..8695bf16 100644
--- a/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/verify.groovy
+++ b/maven-enforcer-plugin/src/it/projects/ban-distribution-management-multi-module-build/verify.groovy
@@ -17,6 +17,6 @@
  * under the License.
  */
 File buildLog = new File( basedir, 'build.log' )
-assert buildLog.text.contains( '[INFO] BUILD FAILURE' )
+assert buildLog.text =~ /\[(INFO|ERROR)\] BUILD FAILURE/
 assert buildLog.text.contains( '[ERROR] Rule 0: org.apache.maven.enforcer.rules.BanDistributionManagement failed with message:' )
 assert buildLog.text.contains( 'You have defined a repository in distributionManagement.' )
diff --git a/maven-enforcer-plugin/src/it/projects/require-same-versions_failure/verify.groovy b/maven-enforcer-plugin/src/it/projects/require-same-versions_failure/verify.groovy
index 6aa420ec..15d722b9 100644
--- a/maven-enforcer-plugin/src/it/projects/require-same-versions_failure/verify.groovy
+++ b/maven-enforcer-plugin/src/it/projects/require-same-versions_failure/verify.groovy
@@ -18,7 +18,7 @@
  */
 def buildLog = new File(basedir, 'build.log').text
 
-assert buildLog.contains('[INFO] BUILD FAILURE')
+assert buildLog =~ /\[(INFO|ERROR)\] BUILD FAILURE/
 assert buildLog.contains('ERROR] Rule 0: org.apache.maven.enforcer.rules.RequireSameVersions failed with message:')
 assert buildLog.contains('ERROR] Rule 1: org.apache.maven.enforcer.rules.RequireSameVersions failed with message:')
 
diff --git a/maven-enforcer-plugin/src/it/projects/require-same-versions_multi-module-build/verify.groovy b/maven-enforcer-plugin/src/it/projects/require-same-versions_multi-module-build/verify.groovy
index 12752bf0..c7ee1dd8 100644
--- a/maven-enforcer-plugin/src/it/projects/require-same-versions_multi-module-build/verify.groovy
+++ b/maven-enforcer-plugin/src/it/projects/require-same-versions_multi-module-build/verify.groovy
@@ -17,6 +17,6 @@
  * under the License.
  */
 File buildLog = new File( basedir, 'build.log' )
-assert buildLog.text.contains( '[INFO] BUILD FAILURE' )
+assert buildLog.text =~ /\[(INFO|ERROR)\] BUILD FAILURE/
 assert buildLog.text.contains( '[ERROR] Rule 0: org.apache.maven.enforcer.rules.RequireSameVersions failed with message:' )
 assert buildLog.text.contains( 'Top level project has version 1.0-SNAPSHOT but current module has different version 1.1-SNAPSHOT' )