You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/09/14 19:47:42 UTC

(maven-enforcer) 02/02: Decouple the includes IT from the commons-lang3 fixture version

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

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

commit b6afbe998e5039a803aa3ffd2a8e9fbaeb00c565
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Mon Sep 14 21:03:23 2026 +0200

    Decouple the includes IT from the commons-lang3 fixture version
    
    The verify script pinned the exact version reported as banned, so a
    POM-only bump of the fixture fails the IT - the same coupling that
    a4e30b9 removed from the log4j-api fixtures.
    
    Match the reported version with a regular expression instead. The
    assertion keeps its strength: commons-lang3 has to be reported and
    jsr305 must not be.
    
    Co-Authored-By: Claude Opus 5 (1M context) <no...@anthropic.com>
---
 .../projects/enforce-bytecode-version-included-deps/verify.groovy  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-included-deps/verify.groovy b/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-included-deps/verify.groovy
index 7a570cc4..d22c1e17 100644
--- a/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-included-deps/verify.groovy
+++ b/maven-enforcer-plugin/src/it/projects/enforce-bytecode-version-included-deps/verify.groovy
@@ -22,6 +22,9 @@ assert file.exists();
 
 String text = file.getText("utf-8");
 
-// the wide exclude is overridden by the include, so only commons-lang3 is analysed
-assert text.contains("Found Banned Dependency: org.apache.commons:commons-lang3:jar:3.12.0")
+// the wide exclude is overridden by the include, so only commons-lang3 is analysed;
+// the version must not be pinned here: bumping the fixture in pom.xml
+// must not require editing this script
+def banned = text =~ /Found Banned Dependency: org\.apache\.commons:commons-lang3:jar:(\d[\d.]*)/
+assert banned.find() : 'expected commons-lang3 to be reported as banned'
 assert !text.contains("Found Banned Dependency: com.google.code.findbugs:jsr305")