From 9be59d03cdebd772a0d441628522ce7cd276ea91 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Tue, 30 Jun 2026 14:24:29 +0200 Subject: [PATCH 1/2] Enable Maven 4 For this to work, several small changes and 2 IT needs to be prevented to run on Maven 4. --- .github/workflows/maven-verify.yml | 2 ++ .../active-profiles_multimodule/invoker.properties | 2 ++ .../projects/active-profiles_multimodule/verify.groovy | 9 +++++++-- src/it/projects/describe-cmd/verify.groovy | 9 ++------- src/it/projects/evaluate-forceStdout/invoker.properties | 6 +++--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml index 932827cf..a8cd280e 100644 --- a/.github/workflows/maven-verify.yml +++ b/.github/workflows/maven-verify.yml @@ -25,3 +25,5 @@ jobs: build: name: Verify uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4 + with: + maven4-enabled: true \ No newline at end of file diff --git a/src/it/projects/active-profiles_multimodule/invoker.properties b/src/it/projects/active-profiles_multimodule/invoker.properties index 00b168d8..5cf9d9ac 100644 --- a/src/it/projects/active-profiles_multimodule/invoker.properties +++ b/src/it/projects/active-profiles_multimodule/invoker.properties @@ -16,3 +16,5 @@ # under the License. invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:active-profiles +# not on Maven 4 until fixed https://github.com/apache/maven/issues/12405 +invoker.maven.version = 4- \ No newline at end of file diff --git a/src/it/projects/active-profiles_multimodule/verify.groovy b/src/it/projects/active-profiles_multimodule/verify.groovy index c2072675..a6655653 100644 --- a/src/it/projects/active-profiles_multimodule/verify.groovy +++ b/src/it/projects/active-profiles_multimodule/verify.groovy @@ -20,7 +20,12 @@ def buildLog = new File( basedir, 'build.log' ); assert buildLog.exists() -assert 2 == buildLog.text.count( ' - mph79 (source: org.apache.maven.its.help:active-profiles_multimodule:1.0-SNAPSHOT)' ) -assert 1 == buildLog.text.count( ' - mph79-child (source: org.apache.maven.its.help:active-profiles_multimodule-module:1.0-SNAPSHOT)' ) +if (mavenVersion.startsWith('4.')) { + assert 2 == buildLog.text.count( ' - mph79 (source: org.apache.maven.its.help:active-profiles_multimodule:pom:1.0-SNAPSHOT)' ) + assert 1 == buildLog.text.count( ' - mph79-child (source: org.apache.maven.its.help:active-profiles_multimodule-module:jar:1.0-SNAPSHOT)' ) +} else { + assert 2 == buildLog.text.count( ' - mph79 (source: org.apache.maven.its.help:active-profiles_multimodule:1.0-SNAPSHOT)' ) + assert 1 == buildLog.text.count( ' - mph79-child (source: org.apache.maven.its.help:active-profiles_multimodule-module:1.0-SNAPSHOT)' ) +} assert 0 == buildLog.text.count( ' - mph79-child-inactive' ) assert 2 == buildLog.text.count( ' - it-repo (source: external)' ) diff --git a/src/it/projects/describe-cmd/verify.groovy b/src/it/projects/describe-cmd/verify.groovy index de3cdb47..90f540fd 100644 --- a/src/it/projects/describe-cmd/verify.groovy +++ b/src/it/projects/describe-cmd/verify.groovy @@ -21,13 +21,8 @@ def result = new File(basedir, 'result-deploy.txt').text; def ls = System.getProperty( "line.separator" ); -// used deprecated methods - FIXME in DescribeMojo -if (mavenVersion.startsWith('4.')) { - assert result.contains("'deploy' is a phase within the 'default' lifecycle, which has the following phases:") -} else { - assert result.contains("'deploy' is a phase corresponding to this plugin:" + ls + - "org.apache.maven.plugins:maven-deploy-plugin") -} +assert result.contains("'deploy' is a phase corresponding to this plugin:" + ls + + "org.apache.maven.plugins:maven-deploy-plugin") result = new File(basedir, 'result-site.txt').text; diff --git a/src/it/projects/evaluate-forceStdout/invoker.properties b/src/it/projects/evaluate-forceStdout/invoker.properties index de210ae7..3ae01809 100644 --- a/src/it/projects/evaluate-forceStdout/invoker.properties +++ b/src/it/projects/evaluate-forceStdout/invoker.properties @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:evaluate -q +invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:evaluate -q --raw-streams invoker.debug = false -# for Maven 4 we need --raw-streams -invoker.maven.version = 4- +# we need --raw-streams (supported since 3.9.10+) +invoker.maven.version = 3.9.10+ From fa1f5619fb965e733bfd6d07355463d9a23fbe30 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Tue, 30 Jun 2026 14:27:23 +0200 Subject: [PATCH 2/2] Drop irrelevant change; this is Maven issue --- .../projects/active-profiles_multimodule/verify.groovy | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/it/projects/active-profiles_multimodule/verify.groovy b/src/it/projects/active-profiles_multimodule/verify.groovy index a6655653..c2072675 100644 --- a/src/it/projects/active-profiles_multimodule/verify.groovy +++ b/src/it/projects/active-profiles_multimodule/verify.groovy @@ -20,12 +20,7 @@ def buildLog = new File( basedir, 'build.log' ); assert buildLog.exists() -if (mavenVersion.startsWith('4.')) { - assert 2 == buildLog.text.count( ' - mph79 (source: org.apache.maven.its.help:active-profiles_multimodule:pom:1.0-SNAPSHOT)' ) - assert 1 == buildLog.text.count( ' - mph79-child (source: org.apache.maven.its.help:active-profiles_multimodule-module:jar:1.0-SNAPSHOT)' ) -} else { - assert 2 == buildLog.text.count( ' - mph79 (source: org.apache.maven.its.help:active-profiles_multimodule:1.0-SNAPSHOT)' ) - assert 1 == buildLog.text.count( ' - mph79-child (source: org.apache.maven.its.help:active-profiles_multimodule-module:1.0-SNAPSHOT)' ) -} +assert 2 == buildLog.text.count( ' - mph79 (source: org.apache.maven.its.help:active-profiles_multimodule:1.0-SNAPSHOT)' ) +assert 1 == buildLog.text.count( ' - mph79-child (source: org.apache.maven.its.help:active-profiles_multimodule-module:1.0-SNAPSHOT)' ) assert 0 == buildLog.text.count( ' - mph79-child-inactive' ) assert 2 == buildLog.text.count( ' - it-repo (source: external)' )