Skip to content

Commit 1673391

Browse files
authored
Merge branch 'master' into gh-11162-consumer-pom-filter-scopes
2 parents 712ed4b + 894abe5 commit 1673391

File tree

162 files changed

+7607
-916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+7607
-916
lines changed

.github/ci-extensions.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ under the License.
2020
<extensions>
2121
<extension>
2222
<groupId>eu.maveniverse.maven.mimir</groupId>
23-
<artifactId>extension</artifactId>
24-
<version>0.7.8</version>
23+
<artifactId>extension3</artifactId>
24+
<version>${env.MIMIR_VERSION}</version>
2525
</extension>
2626
</extensions>

.github/ci-mimir-daemon.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
#
1717

18-
# Mimir Daemon properties
18+
# Mimir Daemon config properties
1919

20-
# Disable JGroups; we don't want/use LAN cache sharing
21-
mimir.jgroups.enabled=false
20+
# Pre-seed itself
21+
mimir.daemon.preSeedItself=true
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# Mimir Session config properties
19+
20+
# do not waste time on this; we maintain the version
21+
mimir.daemon.autoupdate=false

.github/workflows/maven.yml

Lines changed: 69 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ concurrency:
3131
# clear all permissions for GITHUB_TOKEN
3232
permissions: {}
3333

34+
env:
35+
MIMIR_VERSION: 0.9.3
36+
MIMIR_BASEDIR: ~/.mimir
37+
MIMIR_LOCAL: ~/.mimir/local
38+
3439
jobs:
3540
initial-build:
3641
runs-on: ubuntu-latest
@@ -46,25 +51,31 @@ jobs:
4651
with:
4752
persist-credentials: false
4853

49-
- name: Prepare Mimir
54+
- name: Prepare Mimir for Maven 3.x
5055
shell: bash
5156
run: |
52-
mkdir -p ~/.mimir
53-
cp .github/ci-extensions.xml ~/.m2/extensions.xml
54-
cp .github/ci-mimir-daemon.properties ~/.mimir/daemon.properties
55-
56-
- name: Handle Mimir caches
57-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
57+
mkdir -p ${{ env.MIMIR_BASEDIR }}
58+
cp .github/ci-mimir-session.properties ${{ env.MIMIR_BASEDIR }}/session.properties
59+
cp .github/ci-mimir-daemon.properties ${{ env.MIMIR_BASEDIR }}/daemon.properties
60+
cp .github/ci-extensions.xml .mvn/extensions.xml
61+
62+
- name: Restore Mimir caches
63+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
64+
id: restore-cache
5865
with:
59-
path: ~/.mimir/local
60-
key: mimir-${{ runner.os }}-initial-${{ hashFiles('**/pom.xml') }}
61-
restore-keys: |
62-
mimir-${{ runner.os }}-initial-
63-
mimir-${{ runner.os }}-
66+
path: ${{ env.MIMIR_LOCAL }}
67+
key: mimir-${{ runner.os }}-initial
6468

6569
- name: Set up Maven
6670
shell: bash
67-
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper "-Dmaven=4.0.0-rc-3"
71+
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.4:wrapper "-Dmaven=4.0.0-rc-4"
72+
73+
- name: Prepare Mimir for Maven 4.x
74+
shell: bash
75+
run: |
76+
rm .mvn/extensions.xml
77+
mkdir -p ~/.m2
78+
cp .github/ci-extensions.xml ~/.m2/extensions.xml
6879
6980
- name: Build Maven distributions
7081
shell: bash
@@ -74,6 +85,13 @@ jobs:
7485
shell: bash
7586
run: ls -la apache-maven/target
7687

88+
- name: Save Mimir caches
89+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
90+
if: ${{ github.event_name != 'pull_request' && !cancelled() && !failure() }}
91+
with:
92+
path: ${{ env.MIMIR_LOCAL }}
93+
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
94+
7795
- name: Upload Maven distributions
7896
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
7997
with:
@@ -89,7 +107,7 @@ jobs:
89107
fail-fast: false
90108
matrix:
91109
os: [ubuntu-latest, macos-latest, windows-latest]
92-
java: ['17', '21', '24']
110+
java: ['17', '21', '25']
93111
steps:
94112
- name: Set up JDK ${{ matrix.java }}
95113
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
@@ -114,22 +132,24 @@ jobs:
114132
with:
115133
persist-credentials: false
116134

117-
- name: Prepare Mimir
135+
- name: Prepare Mimir for Maven 4.x
118136
shell: bash
119137
run: |
138+
mkdir -p ${{ env.MIMIR_BASEDIR }}
139+
cp .github/ci-mimir-session.properties ${{ env.MIMIR_BASEDIR }}/session.properties
140+
cp .github/ci-mimir-daemon.properties ${{ env.MIMIR_BASEDIR }}/daemon.properties
120141
mkdir -p ~/.m2
121-
mkdir -p ~/.mimir
122142
cp .github/ci-extensions.xml ~/.m2/extensions.xml
123-
cp .github/ci-mimir-daemon.properties ~/.mimir/daemon.properties
124143
125-
- name: Handle Mimir caches
126-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
144+
- name: Restore Mimir caches
145+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
146+
id: restore-cache
127147
with:
128-
path: ~/.mimir/local
129-
key: mimir-${{ runner.os }}-full-${{ hashFiles('**/pom.xml') }}
148+
path: ${{ env.MIMIR_LOCAL }}
149+
key: mimir-full-${{ matrix.os }}-${{ matrix.java }}
130150
restore-keys: |
131-
mimir-${{ runner.os }}-full-
132-
mimir-${{ runner.os }}-
151+
mimir-full-${{ matrix.os }}-
152+
mimir-full-
133153
134154
- name: Download Maven distribution
135155
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4
@@ -166,6 +186,13 @@ jobs:
166186
shell: bash
167187
run: mvn site -e -B -V -Preporting
168188

189+
- name: Save Mimir caches
190+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
191+
if: ${{ github.event_name != 'pull_request' && !cancelled() && !failure() }}
192+
with:
193+
path: ${{ env.MIMIR_LOCAL }}
194+
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
195+
169196
- name: Upload test artifacts
170197
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
171198
if: failure() || cancelled()
@@ -180,7 +207,7 @@ jobs:
180207
fail-fast: false
181208
matrix:
182209
os: [ubuntu-latest, macos-latest, windows-latest]
183-
java: ['17', '21', '24']
210+
java: ['17', '21', '25']
184211
steps:
185212
- name: Set up JDK ${{ matrix.java }}
186213
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
@@ -193,22 +220,24 @@ jobs:
193220
with:
194221
persist-credentials: false
195222

196-
- name: Prepare Mimir
223+
- name: Prepare Mimir for Maven 4.x
197224
shell: bash
198225
run: |
226+
mkdir -p ${{ env.MIMIR_BASEDIR }}
227+
cp .github/ci-mimir-session.properties ${{ env.MIMIR_BASEDIR }}/session.properties
228+
cp .github/ci-mimir-daemon.properties ${{ env.MIMIR_BASEDIR }}/daemon.properties
199229
mkdir -p ~/.m2
200-
mkdir -p ~/.mimir
201230
cp .github/ci-extensions.xml ~/.m2/extensions.xml
202-
cp .github/ci-mimir-daemon.properties ~/.mimir/daemon.properties
203231
204-
- name: Handle Mimir caches
205-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
232+
- name: Restore Mimir caches
233+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
234+
id: restore-cache
206235
with:
207-
path: ~/.mimir/local
208-
key: mimir-${{ runner.os }}-its-${{ hashFiles('**/pom.xml') }}
236+
path: ${{ env.MIMIR_LOCAL }}
237+
key: mimir-its-${{ matrix.os }}-${{ matrix.java }}
209238
restore-keys: |
210-
mimir-${{ runner.os }}-its-
211-
mimir-${{ runner.os }}-
239+
mimir-its-${{ matrix.os }}-
240+
mimir-its-
212241
213242
- name: Download Maven distribution
214243
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4
@@ -241,6 +270,13 @@ jobs:
241270
shell: bash
242271
run: mvn install -e -B -V -Prun-its,mimir
243272

273+
- name: Save Mimir caches
274+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
275+
if: ${{ github.event_name != 'pull_request' && !cancelled() && !failure() }}
276+
with:
277+
path: ${{ env.MIMIR_LOCAL }}
278+
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
279+
244280
- name: Upload test artifacts
245281
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
246282
if: failure() || cancelled()

apache-maven/src/assembly/maven/conf/maven-user.properties

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,34 @@
2929
# If the first character of an item is a question mark, the load will silently fail if the file does not exist.
3030
${includes} = ?"${maven.user.conf}/maven-user.properties", \
3131
?"${maven.project.conf}/maven-user.properties"
32+
33+
#
34+
# Maven Cache Configuration
35+
#
36+
# Controls caching behavior for different request types during Maven builds.
37+
# Format: RequestType { scope:SCOPE ref:REFERENCE_TYPE }
38+
#
39+
# SCOPE OPTIONS:
40+
# session - Cache for entire Maven session (all modules in multi-module build)
41+
# request - Cache only for current request + its child requests
42+
# none - Disable caching entirely
43+
#
44+
# REFERENCE OPTIONS:
45+
# hard - Strong reference (stays in memory, faster access)
46+
# soft - Weak reference (can be garbage collected under memory pressure)
47+
#
48+
# CONFIGURATION BREAKDOWN:
49+
# SourceCacheKey - File and RAW model requests (session/hard for consistent file access)
50+
# DefaultArtifactResolverRequest - Artifact resolution results (session/hard to avoid re-resolving)
51+
# DefaultVersionResolverRequest - Version resolution results (session/soft, less critical than artifacts)
52+
# RgavCacheKey - BOM import caching (session/soft, typically resolved once)
53+
# DefaultModelBuilderRequest - Model building operations (none, ensures fresh dynamic builds)
54+
# * - Fallback for all other requests (request/soft for temporary child request caching)
55+
#
56+
maven.cache.config = \
57+
SourceCacheKey { scope:session ref:hard } \
58+
DefaultArtifactResolverRequest { scope:session ref:hard } \
59+
DefaultVersionResolverRequest { scope:session ref:soft } \
60+
RgavCacheKey { scope:session ref:soft } \
61+
DefaultModelBuilderRequest { scope:none } \
62+
* { scope:request ref:soft }

api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,5 +662,70 @@ public final class Constants {
662662
*/
663663
public static final String MAVEN_LOGGER_LOG_PREFIX = MAVEN_LOGGER_PREFIX + "log.";
664664

665+
/**
666+
* User property key for cache configuration.
667+
*
668+
* @since 4.1.0
669+
*/
670+
public static final String MAVEN_CACHE_CONFIG_PROPERTY = "maven.cache.config";
671+
672+
/**
673+
* User property to enable cache statistics display at the end of the build.
674+
* When set to true, detailed cache statistics including hit/miss ratios,
675+
* request type breakdowns, and retention policy effectiveness will be displayed
676+
* when the build completes.
677+
*
678+
* @since 4.1.0
679+
*/
680+
@Config(type = "java.lang.Boolean", defaultValue = "false")
681+
public static final String MAVEN_CACHE_STATS = "maven.cache.stats";
682+
683+
/**
684+
* User property to configure separate reference types for cache keys.
685+
* This enables fine-grained analysis of cache misses caused by key vs value evictions.
686+
* Supported values are {@code HARD}, {@code SOFT} and {@code WEAK}.
687+
*
688+
* @since 4.1.0
689+
*/
690+
public static final String MAVEN_CACHE_KEY_REFS = "maven.cache.keyValueRefs";
691+
692+
/**
693+
* User property to configure separate reference types for cache values.
694+
* This enables fine-grained analysis of cache misses caused by key vs value evictions.
695+
* Supported values are {@code HARD}, {@code SOFT} and {@code WEAK}.
696+
*
697+
* @since 4.1.0
698+
*/
699+
public static final String MAVEN_CACHE_VALUE_REFS = "maven.cache.keyValueRefs";
700+
701+
/**
702+
* User property key for configuring which object types are pooled by ModelObjectProcessor.
703+
* Value should be a comma-separated list of simple class names (e.g., "Dependency,Plugin,Build").
704+
* Default is "Dependency" for backward compatibility.
705+
*
706+
* @since 4.1.0
707+
*/
708+
@Config(defaultValue = "Dependency")
709+
public static final String MAVEN_MODEL_PROCESSOR_POOLED_TYPES = "maven.model.processor.pooledTypes";
710+
711+
/**
712+
* User property key for configuring the default reference type used by ModelObjectProcessor.
713+
* Valid values are: "SOFT", "HARD", "WEAK", "NONE".
714+
* Default is "HARD" for optimal performance.
715+
*
716+
* @since 4.1.0
717+
*/
718+
@Config(defaultValue = "HARD")
719+
public static final String MAVEN_MODEL_PROCESSOR_REFERENCE_TYPE = "maven.model.processor.referenceType";
720+
721+
/**
722+
* User property key prefix for configuring per-object-type reference types.
723+
* Format: maven.model.processor.referenceType.{ClassName} = {ReferenceType}
724+
* Example: maven.model.processor.referenceType.Dependency = SOFT
725+
*
726+
* @since 4.1.0
727+
*/
728+
public static final String MAVEN_MODEL_PROCESSOR_REFERENCE_TYPE_PREFIX = "maven.model.processor.referenceType.";
729+
665730
private Constants() {}
666731
}

api/maven-api-core/src/main/java/org/apache/maven/api/feature/Features.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
package org.apache.maven.api.feature;
2020

2121
import java.util.Map;
22-
import java.util.Properties;
2322

2423
import org.apache.maven.api.Constants;
2524
import org.apache.maven.api.annotations.Nullable;
@@ -55,10 +54,6 @@ public static boolean deployBuildPom(@Nullable Map<String, ?> userProperties) {
5554
return doGet(userProperties, Constants.MAVEN_DEPLOY_BUILD_POM, true);
5655
}
5756

58-
private static boolean doGet(Properties userProperties, String key, boolean def) {
59-
return doGet(userProperties != null ? userProperties.get(key) : null, def);
60-
}
61-
6257
private static boolean doGet(Map<String, ?> userProperties, String key, boolean def) {
6358
return doGet(userProperties != null ? userProperties.get(key) : null, def);
6459
}

api/maven-api-core/src/main/java/org/apache/maven/api/services/ArtifactDeployerException.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*/
1919
package org.apache.maven.api.services;
2020

21-
import java.io.Serial;
22-
2321
import org.apache.maven.api.annotations.Experimental;
2422

2523
/**
@@ -30,12 +28,6 @@
3028
@Experimental
3129
public class ArtifactDeployerException extends MavenException {
3230

33-
/**
34-
*
35-
*/
36-
@Serial
37-
private static final long serialVersionUID = 7421964724059077698L;
38-
3931
/**
4032
* @param message the message of the error
4133
* @param e {@link Exception}

api/maven-api-core/src/main/java/org/apache/maven/api/services/ArtifactInstallerException.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*/
1919
package org.apache.maven.api.services;
2020

21-
import java.io.Serial;
22-
2321
import org.apache.maven.api.annotations.Experimental;
2422

2523
/**
@@ -28,12 +26,6 @@
2826
@Experimental
2927
public class ArtifactInstallerException extends MavenException {
3028

31-
/**
32-
*
33-
*/
34-
@Serial
35-
private static final long serialVersionUID = 3652561971360586373L;
36-
3729
/**
3830
* @param message the message of the error
3931
* @param e {@link Exception}

0 commit comments

Comments
 (0)