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/10/13 13:08:54 UTC

(maven-gh-actions-shared) 01/01: Make the run-its profile optional and default the Maven of matrix-include entries

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

slachiewicz pushed a commit to branch agent/v5-optional-its-maven-fallback
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git

commit 658b24dd6c165608953ede7f57f4ae7b4a55cdae
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Tue Oct 13 15:08:47 2026 +0200

    Make the run-its profile optional and default the Maven of matrix-include entries
    
    Maven 4 fails on a requested profile the project lacks; -P "?run-its" passes on 3.9, 3.10 and 4. A matrix-include entry without a maven key now builds with the fail-fast Maven instead of an empty version.
---
 .github/workflows/maven-verify.yml | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml
index 0374b6a..86897cd 100644
--- a/.github/workflows/maven-verify.yml
+++ b/.github/workflows/maven-verify.yml
@@ -158,7 +158,7 @@ on:
       ff-goal:
         description: The Maven goal used by fail-fast-build job
         required: false
-        default: '-P run-its verify'
+        default: '-P "?run-its" verify'
         type: string
 
       ff-site-run:
@@ -182,7 +182,7 @@ on:
       verify-goal:
         description: The Maven goal used by verfy jobs
         required: false
-        default: '-P run-its verify'
+        default: '-P "?run-its" verify'
         type: string
 
       verify-fail-fast:
@@ -434,7 +434,7 @@ jobs:
       inputs.matrix-enabled && ( !inputs.ff-run || needs.fail-fast-build.result == 'success' ) &&
       !startsWith(github.event.head_commit.message , '[maven-release-plugin] prepare release')
     needs: [setup-maven-version, fail-fast-build]
-    name: ${{ matrix.os }} jdk-${{ matrix.jdk }}-${{ matrix.distribution }} ${{ matrix.maven }}
+    name: ${{ matrix.os }} jdk-${{ matrix.jdk }}-${{ matrix.distribution }} ${{ matrix.maven || needs.setup-maven-version.outputs.version }}
     timeout-minutes: ${{ inputs.timeout-minutes }}
     runs-on: ${{ matrix.os }}
 
@@ -536,7 +536,7 @@ jobs:
         if: steps.should-run.conclusion == 'success'
         shell: bash
         env:
-          MAVEN_VERSION: ${{ matrix.maven }}
+          MAVEN_VERSION: ${{ matrix.maven || needs.setup-maven-version.outputs.version }}
         run: |
           runner_version="$(mvn --batch-mode --version -q 2>/dev/null | head -n 1 | tr -d '\r')"
           echo "Runner's Maven: ${runner_version:-none}, requested: $MAVEN_VERSION"
@@ -547,14 +547,14 @@ jobs:
         if: steps.should-run.conclusion == 'success' && steps.runner-maven.outputs.matches != 'true'
         uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
         with:
-          path: ~/.m2/dists/apache-maven-${{ matrix.maven }}
-          key: maven-dist-${{ runner.os }}-${{ matrix.maven }}
+          path: ~/.m2/dists/apache-maven-${{ matrix.maven || needs.setup-maven-version.outputs.version }}
+          key: maven-dist-${{ runner.os }}-${{ matrix.maven || needs.setup-maven-version.outputs.version }}
 
       - name: Download Maven
         if: steps.should-run.conclusion == 'success' && steps.runner-maven.outputs.matches != 'true' && steps.maven-cache.outputs.cache-hit != 'true'
         shell: bash
         env:
-          MAVEN_VERSION: ${{ matrix.maven }}
+          MAVEN_VERSION: ${{ matrix.maven || needs.setup-maven-version.outputs.version }}
         run: |
           url="https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/$MAVEN_VERSION/apache-maven-$MAVEN_VERSION-bin.tar.gz"
           # a Unix-style path: tar in Git Bash on Windows takes "D:" in $RUNNER_TEMP for a remote host
@@ -580,14 +580,14 @@ jobs:
         if: steps.should-run.conclusion == 'success' && steps.runner-maven.outputs.matches != 'true' && steps.maven-cache.outputs.cache-hit != 'true' && github.ref_name == github.event.repository.default_branch
         uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
         with:
-          path: ~/.m2/dists/apache-maven-${{ matrix.maven }}
-          key: maven-dist-${{ runner.os }}-${{ matrix.maven }}
+          path: ~/.m2/dists/apache-maven-${{ matrix.maven || needs.setup-maven-version.outputs.version }}
+          key: maven-dist-${{ runner.os }}-${{ matrix.maven || needs.setup-maven-version.outputs.version }}
 
       - name: Set up Maven
         if: steps.should-run.conclusion == 'success' && steps.runner-maven.outputs.matches != 'true'
         shell: bash
         env:
-          MAVEN_VERSION: ${{ matrix.maven }}
+          MAVEN_VERSION: ${{ matrix.maven || needs.setup-maven-version.outputs.version }}
         run: |
           bin="$HOME/.m2/dists/apache-maven-$MAVEN_VERSION/bin"
           if command -v cygpath > /dev/null; then bin="$(cygpath --windows "$bin")"; fi
@@ -601,7 +601,7 @@ jobs:
         uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
         if: steps.should-run.conclusion == 'success' && failure() && inputs.failure-upload-path != ''
         with:
-          name: ${{ github.run_number }}-failure-${{ matrix.os }}-${{ matrix.jdk }}-${{ matrix.distribution }}-${{ matrix.maven }}
+          name: ${{ github.run_number }}-failure-${{ matrix.os }}-${{ matrix.jdk }}-${{ matrix.distribution }}-${{ matrix.maven || needs.setup-maven-version.outputs.version }}
           path: ${{ inputs.failure-upload-path }}
 
       - name: Show free disk space