Skip to content

Commit 4e3d14d

Browse files
Maven 4.0.x backport mimir (#11180)
Backport following commits: * Java 25 1fc1972 * Mimir 0.9.3 1749a5f --------- Co-authored-by: Slawomir Jaranowski <[email protected]>
1 parent 1147e78 commit 4e3d14d

File tree

20 files changed

+97
-176
lines changed

20 files changed

+97
-176
lines changed

.github/ci-extensions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ under the License.
2121
<extension>
2222
<groupId>eu.maveniverse.maven.mimir</groupId>
2323
<artifactId>extension3</artifactId>
24-
<version>0.8.1</version>
24+
<version>${env.MIMIR_VERSION}</version>
2525
</extension>
2626
</extensions>

.github/ci-mimir-daemon.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717

1818
# 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: 34 additions & 19 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,23 +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
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
5561
5662
- name: Restore Mimir caches
5763
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
5864
id: restore-cache
5965
with:
60-
path: ~/.mimir/local
66+
path: ${{ env.MIMIR_LOCAL }}
6167
key: mimir-${{ runner.os }}-initial
6268

6369
- name: Set up Maven
6470
shell: bash
65-
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
6679
6780
- name: Build Maven distributions
6881
shell: bash
@@ -76,7 +89,7 @@ jobs:
7689
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
7790
if: ${{ github.event_name != 'pull_request' && !cancelled() && !failure() }}
7891
with:
79-
path: ~/.mimir/local
92+
path: ${{ env.MIMIR_LOCAL }}
8093
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
8194

8295
- name: Upload Maven distributions
@@ -94,7 +107,7 @@ jobs:
94107
fail-fast: false
95108
matrix:
96109
os: [ubuntu-latest, macos-latest, windows-latest]
97-
java: ['17', '21', '24']
110+
java: ['17', '21', '25']
98111
steps:
99112
- name: Set up JDK ${{ matrix.java }}
100113
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
@@ -119,19 +132,20 @@ jobs:
119132
with:
120133
persist-credentials: false
121134

122-
- name: Prepare Mimir
135+
- name: Prepare Mimir for Maven 4.x
123136
shell: bash
124137
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
125141
mkdir -p ~/.m2
126-
mkdir -p ~/.mimir
127142
cp .github/ci-extensions.xml ~/.m2/extensions.xml
128-
cp .github/ci-mimir-daemon.properties ~/.mimir/daemon.properties
129143
130144
- name: Restore Mimir caches
131145
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
132146
id: restore-cache
133147
with:
134-
path: ~/.mimir/local
148+
path: ${{ env.MIMIR_LOCAL }}
135149
key: mimir-full-${{ matrix.os }}-${{ matrix.java }}
136150
restore-keys: |
137151
mimir-full-${{ matrix.os }}-
@@ -180,7 +194,7 @@ jobs:
180194
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
181195
if: ${{ github.event_name != 'pull_request' && !cancelled() && !failure() }}
182196
with:
183-
path: ~/.mimir/local
197+
path: ${{ env.MIMIR_LOCAL }}
184198
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
185199

186200
- name: Upload test artifacts
@@ -197,7 +211,7 @@ jobs:
197211
fail-fast: false
198212
matrix:
199213
os: [ubuntu-latest, macos-latest, windows-latest]
200-
java: ['17', '21', '24']
214+
java: ['17', '21', '25']
201215
steps:
202216
- name: Set up JDK ${{ matrix.java }}
203217
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
@@ -210,19 +224,20 @@ jobs:
210224
with:
211225
persist-credentials: false
212226

213-
- name: Prepare Mimir
227+
- name: Prepare Mimir for Maven 4.x
214228
shell: bash
215229
run: |
230+
mkdir -p ${{ env.MIMIR_BASEDIR }}
231+
cp .github/ci-mimir-session.properties ${{ env.MIMIR_BASEDIR }}/session.properties
232+
cp .github/ci-mimir-daemon.properties ${{ env.MIMIR_BASEDIR }}/daemon.properties
216233
mkdir -p ~/.m2
217-
mkdir -p ~/.mimir
218234
cp .github/ci-extensions.xml ~/.m2/extensions.xml
219-
cp .github/ci-mimir-daemon.properties ~/.mimir/daemon.properties
220235
221236
- name: Restore Mimir caches
222237
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
223238
id: restore-cache
224239
with:
225-
path: ~/.mimir/local
240+
path: ${{ env.MIMIR_LOCAL }}
226241
key: mimir-its-${{ matrix.os }}-${{ matrix.java }}
227242
restore-keys: |
228243
mimir-its-${{ matrix.os }}-
@@ -267,7 +282,7 @@ jobs:
267282
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
268283
if: ${{ github.event_name != 'pull_request' && !cancelled() && !failure() }}
269284
with:
270-
path: ~/.mimir/local
285+
path: ${{ env.MIMIR_LOCAL }}
271286
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
272287

273288
- name: Upload test artifacts

impl/maven-cli/pom.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,14 @@ under the License.
235235
<artifactId>jline-native</artifactId>
236236
<scope>test</scope>
237237
</dependency>
238+
<dependency>
239+
<groupId>eu.maveniverse.maven.mimir</groupId>
240+
<artifactId>testing</artifactId>
241+
<scope>test</scope>
242+
</dependency>
238243
</dependencies>
239244

240245
<build>
241-
<testResources>
242-
<testResource>
243-
<filtering>true</filtering>
244-
<directory>src/test/resources-filtered</directory>
245-
</testResource>
246-
</testResources>
247246
<plugins>
248247
<plugin>
249248
<groupId>org.apache.maven.plugins</groupId>

impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvn/MavenInvokerTestSupport.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.util.List;
2929
import java.util.Map;
3030

31+
import eu.maveniverse.maven.mimir.testing.MimirInfuser;
3132
import org.apache.maven.api.cli.Invoker;
3233
import org.apache.maven.api.cli.Parser;
3334
import org.apache.maven.api.cli.ParserRequest;
@@ -98,7 +99,7 @@ protected Map<String, String> invoke(Path cwd, Path userHome, Collection<String>
9899
Files.createDirectories(appJava.getParent());
99100
Files.writeString(appJava, APP_JAVA_STRING);
100101

101-
MimirInfuser.infuse(userHome);
102+
MimirInfuser.infuseUW(userHome);
102103

103104
HashMap<String, String> logs = new HashMap<>();
104105
Parser parser = createParser();

impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvn/MimirInfuser.java

Lines changed: 0 additions & 57 deletions
This file was deleted.

impl/maven-cli/src/test/resources-filtered/ut-mimir.properties

Lines changed: 0 additions & 8 deletions
This file was deleted.

impl/maven-executor/pom.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ under the License.
5353
<artifactId>junit-jupiter-params</artifactId>
5454
<scope>test</scope>
5555
</dependency>
56+
<dependency>
57+
<groupId>eu.maveniverse.maven.mimir</groupId>
58+
<artifactId>testing</artifactId>
59+
<scope>test</scope>
60+
</dependency>
5661
<dependency>
5762
<groupId>org.apache.maven</groupId>
5863
<artifactId>apache-maven</artifactId>
@@ -70,12 +75,6 @@ under the License.
7075
</dependencies>
7176

7277
<build>
73-
<testResources>
74-
<testResource>
75-
<filtering>true</filtering>
76-
<directory>src/test/resources-filtered</directory>
77-
</testResource>
78-
</testResources>
7978
<plugins>
8079
<plugin>
8180
<groupId>org.apache.maven.plugins</groupId>

impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.Collection;
2727
import java.util.List;
2828

29+
import eu.maveniverse.maven.mimir.testing.MimirInfuser;
2930
import org.apache.maven.api.annotations.Nullable;
3031
import org.apache.maven.api.cli.Executor;
3132
import org.apache.maven.api.cli.ExecutorRequest;
@@ -316,7 +317,7 @@ public static void main(String... args) {
316317
protected void execute(@Nullable Path logFile, Collection<ExecutorRequest> requests) throws Exception {
317318
Executor invoker = createAndMemoizeExecutor();
318319
for (ExecutorRequest request : requests) {
319-
MimirInfuser.infuse(request.userHomeDirectory());
320+
MimirInfuser.infuseUW(request.userHomeDirectory());
320321
int exitCode = invoker.execute(request);
321322
if (exitCode != 0) {
322323
throw new FailedExecution(request, exitCode, logFile == null ? "" : Files.readString(logFile));

0 commit comments

Comments
 (0)