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

cstamas pushed a commit to branch maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/maven-4.0.x by this push:
     new f475fed530 Mimir updates (#11161) (#11166)
f475fed530 is described below

commit f475fed53041bd2e004a2044fe9d2a24f154e5e6
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Tue Sep 23 14:53:27 2025 +0200

    Mimir updates (#11161) (#11166)
    
    Changes:
    * update Mimir to latest 0.8.1 version
    * update infusers as well
    * cache changes (see below)
    
    Cache strategy changes:
    * initial build: it is snowballing one cache when build is not about PR
    * full (rebuild itself + site with itself) and its build: it is snowballing 
cache differentiated by OS/JDK when build is not about PR
    
    Current problems: on unchanged POM (ie. new IT added), the dependencies ITs 
pull from Central will be cached by Mimir, but due "cache hit" the new cache 
will not get stored. Hence, Mimir caching was basically lost. Also, there was a 
mixup of caches from PRs and main branches. Finally, matrix jobs were competing 
for cache store.
    
    Backport of 7872c6d80549053ff195d421a161f217b64c7dbd
---
 .github/ci-extensions.xml                          |  4 +-
 .github/ci-mimir-daemon.properties                 |  2 +-
 .github/workflows/maven.yml                        | 53 +++++++++++++++-------
 .../maven/cling/invoker/mvn/MimirInfuser.java      |  2 +-
 .../apache/maven/cling/executor/MimirInfuser.java  |  2 +-
 5 files changed, 42 insertions(+), 21 deletions(-)

diff --git a/.github/ci-extensions.xml b/.github/ci-extensions.xml
index 5c6a0b4378..91b00e7b35 100644
--- a/.github/ci-extensions.xml
+++ b/.github/ci-extensions.xml
@@ -20,7 +20,7 @@ under the License.
 <extensions>
   <extension>
     <groupId>eu.maveniverse.maven.mimir</groupId>
-    <artifactId>extension</artifactId>
-    <version>0.7.8</version>
+    <artifactId>extension3</artifactId>
+    <version>0.8.1</version>
   </extension>
 </extensions>
\ No newline at end of file
diff --git a/.github/ci-mimir-daemon.properties 
b/.github/ci-mimir-daemon.properties
index 86a84b6ac5..0efaa05039 100644
--- a/.github/ci-mimir-daemon.properties
+++ b/.github/ci-mimir-daemon.properties
@@ -15,7 +15,7 @@
 #  limitations under the License.
 #
 
-# Mimir Daemon properties
+# Mimir Daemon config properties
 
 # Disable JGroups; we don't want/use LAN cache sharing
 mimir.jgroups.enabled=false
\ No newline at end of file
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 04f3eef000..5e6e250916 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -53,14 +53,12 @@ jobs:
           cp .github/ci-extensions.xml ~/.m2/extensions.xml
           cp .github/ci-mimir-daemon.properties ~/.mimir/daemon.properties
 
-      - name: Handle Mimir caches
-        uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
+      - name: Restore Mimir caches
+        uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # 
v4
+        id: restore-cache
         with:
           path: ~/.mimir/local
-          key: mimir-${{ runner.os }}-initial-${{ hashFiles('**/pom.xml') }}
-          restore-keys: |
-            mimir-${{ runner.os }}-initial-
-            mimir-${{ runner.os }}-
+          key: mimir-${{ runner.os }}-initial
 
       - name: Set up Maven
         shell: bash
@@ -74,6 +72,13 @@ jobs:
         shell: bash
         run: ls -la apache-maven/target
 
+      - name: Save Mimir caches
+        uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
+        if: ${{ github.event_name != 'pull_request' && !cancelled() && 
!failure() }}
+        with:
+          path: ~/.mimir/local
+          key: ${{ steps.restore-cache.outputs.cache-primary-key }}
+
       - name: Upload Maven distributions
         uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 
# v4
         with:
@@ -122,14 +127,15 @@ jobs:
           cp .github/ci-extensions.xml ~/.m2/extensions.xml
           cp .github/ci-mimir-daemon.properties ~/.mimir/daemon.properties
 
-      - name: Handle Mimir caches
-        uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
+      - name: Restore Mimir caches
+        uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # 
v4
+        id: restore-cache
         with:
           path: ~/.mimir/local
-          key: mimir-${{ runner.os }}-full-${{ hashFiles('**/pom.xml') }}
+          key: mimir-full-${{ matrix.os }}-${{ matrix.java }}
           restore-keys: |
-            mimir-${{ runner.os }}-full-
-            mimir-${{ runner.os }}-
+            mimir-full-${{ matrix.os }}-
+            mimir-full-
 
       - name: Download Maven distribution
         uses: 
actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4
@@ -170,6 +176,13 @@ jobs:
         shell: bash
         run: mvn site -e -B -V -Preporting
 
+      - name: Save Mimir caches
+        uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
+        if: ${{ github.event_name != 'pull_request' && !cancelled() && 
!failure() }}
+        with:
+          path: ~/.mimir/local
+          key: ${{ steps.restore-cache.outputs.cache-primary-key }}
+
       - name: Upload test artifacts
         uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 
# v4
         if: failure()
@@ -205,14 +218,15 @@ jobs:
           cp .github/ci-extensions.xml ~/.m2/extensions.xml
           cp .github/ci-mimir-daemon.properties ~/.mimir/daemon.properties
 
-      - name: Handle Mimir caches
-        uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
+      - name: Restore Mimir caches
+        uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # 
v4
+        id: restore-cache
         with:
           path: ~/.mimir/local
-          key: mimir-${{ runner.os }}-its-${{ hashFiles('**/pom.xml') }}
+          key: mimir-its-${{ matrix.os }}-${{ matrix.java }}
           restore-keys: |
-            mimir-${{ runner.os }}-its-
-            mimir-${{ runner.os }}-
+            mimir-its-${{ matrix.os }}-
+            mimir-its-
 
       - name: Download Maven distribution
         uses: 
actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4
@@ -249,6 +263,13 @@ jobs:
         shell: bash
         run: mvn install -e -B -V -Prun-its,mimir
 
+      - name: Save Mimir caches
+        uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
+        if: ${{ github.event_name != 'pull_request' && !cancelled() && 
!failure() }}
+        with:
+          path: ~/.mimir/local
+          key: ${{ steps.restore-cache.outputs.cache-primary-key }}
+
       - name: Upload test artifacts
         uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 
# v4
         if: failure()
diff --git 
a/impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvn/MimirInfuser.java
 
b/impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvn/MimirInfuser.java
index 2fa0f034c8..957a637e43 100644
--- 
a/impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvn/MimirInfuser.java
+++ 
b/impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvn/MimirInfuser.java
@@ -37,7 +37,7 @@ public static void infuse(Path userHome) throws IOException {
         if (Files.isRegularFile(realUserWideExtensions)) {
             String realUserWideExtensionsString = 
Files.readString(realUserWideExtensions);
             if 
(realUserWideExtensionsString.contains("<groupId>eu.maveniverse.maven.mimir</groupId>")
-                    && 
realUserWideExtensionsString.contains("<artifactId>extension</artifactId>")) {
+                    && 
realUserWideExtensionsString.contains("<artifactId>extension3</artifactId>")) {
                 Path userWideExtensions = 
userHome.resolve(".m2").resolve("extensions.xml");
                 // some tests do prepare project and user wide extensions; 
skip those for now
                 if (!Files.isRegularFile(userWideExtensions)) {
diff --git 
a/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MimirInfuser.java
 
b/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MimirInfuser.java
index 4cf53bf0c2..ff3da70c57 100644
--- 
a/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MimirInfuser.java
+++ 
b/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MimirInfuser.java
@@ -37,7 +37,7 @@ public static void infuse(Path userHome) throws IOException {
         if (Files.isRegularFile(realUserWideExtensions)) {
             String realUserWideExtensionsString = 
Files.readString(realUserWideExtensions);
             if 
(realUserWideExtensionsString.contains("<groupId>eu.maveniverse.maven.mimir</groupId>")
-                    && 
realUserWideExtensionsString.contains("<artifactId>extension</artifactId>")) {
+                    && 
realUserWideExtensionsString.contains("<artifactId>extension3</artifactId>")) {
                 Path userWideExtensions = 
userHome.resolve(".m2").resolve("extensions.xml");
                 // some tests do prepare project and user wide extensions; 
skip those for now
                 if (!Files.isRegularFile(userWideExtensions)) {

Reply via email to