Skip to content

Commit 0667c34

Browse files
authored
Merge branch 'eclipse-m2e:main' into feat-9082949060688351234-rewriteManifests
2 parents 7407d1f + 7f2300a commit 0667c34

File tree

18 files changed

+179
-80
lines changed

18 files changed

+179
-80
lines changed

.github/workflows/junit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
done
4646
4747
- name: Publish Test Results
48-
uses: EnricoMi/publish-unit-test-result-action@34d7c956a59aed1bfebf31df77b8de55db9bbaaf # v2.21.0
48+
uses: EnricoMi/publish-unit-test-result-action@27d65e188ec43221b20d26de30f4892fad91df2f # v2.22.0
4949
with:
5050
commit: ${{ github.event.workflow_run.head_sha }}
5151
event_file: artifacts/Event File/event.json

.github/workflows/maven.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
timeout-minutes: 45
2121

2222
steps:
23-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2424
with:
2525
fetch-depth: 0
2626
submodules: true
27-
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
27+
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
2828
with:
2929
java-version: |
3030
17
@@ -35,7 +35,7 @@ jobs:
3535
with:
3636
maven-version: 3.9.11
3737
- name: Cache local Maven repository
38-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
38+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
3939
with:
4040
path: ~/.m2/repository
4141
# re-cache on changes in the pom and target files
@@ -51,7 +51,7 @@ jobs:
5151
-Dmaven.test.failure.ignore=true
5252
-Dtycho.surefire.deleteWorkDir=true
5353
- name: Upload Test Results
54-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
54+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
5555
with:
5656
name: test-results-${{ matrix.os }}
5757
if-no-files-found: warn
@@ -62,7 +62,7 @@ jobs:
6262
runs-on: ubuntu-latest
6363
steps:
6464
- name: Upload
65-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
65+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
6666
with:
6767
name: Event File
6868
path: ${{ github.event_path }}

.mvn/extensions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<extension>
44
<groupId>org.eclipse.tycho</groupId>
55
<artifactId>tycho-build</artifactId>
6-
<version>5.0.0</version>
6+
<version>${tycho-version}</version>
77
</extension>
88
</extensions>

.mvn/maven.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
--fail-at-end
66
-Dtycho.localArtifacts=ignore
77
-Dtycho.target.pomDependencies=consider
8-
-Dtycho-version=5.0.1-SNAPSHOT
8+
-Dtycho-version=5.0.2

RELEASE_NOTES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Eclipse m2e - Release notes
22

3+
## 2.10.1
4+
5+
* 📅 Release Date: _expected_ beginning of March 2026
6+
7+
### Embedded and use Maven 3.9.12
8+
9+
Updated the embedded Maven from version 3.9.11 to 3.9.12; [Maven 3.9.12 Release Notes](https://maven.apache.org/docs/3.9.12/release-notes.html).
10+
11+
312
## 2.10.0
413

514
* 📅 Release Date: 03rd December 2025

m2e-parent/pom.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,6 @@
8181
<goal>plugin-source</goal>
8282
</goals>
8383
</execution>
84-
<execution>
85-
<id>feature-source</id>
86-
<goals>
87-
<goal>feature-source</goal>
88-
</goals>
89-
<configuration>
90-
<excludes>
91-
<plugin id="org.eclipse.m2e.workspace.cli" />
92-
</excludes>
93-
</configuration>
94-
</execution>
9584
</executions>
9685
</plugin>
9786
<plugin>

org.eclipse.m2e.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %Bundle-Name
44
Bundle-SymbolicName: org.eclipse.m2e.core;singleton:=true
5-
Bundle-Version: 2.7.600.qualifier
5+
Bundle-Version: 2.7.700.qualifier
66
Bundle-Activator: org.eclipse.m2e.core.internal.MavenPluginActivator
77
Bundle-Vendor: %Bundle-Vendor
88
Bundle-Localization: plugin

org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/FilterRepositorySystemSession.java

Lines changed: 126 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,159 @@
1414
package org.eclipse.m2e.core.internal.embedder;
1515

1616
import org.eclipse.aether.DefaultRepositorySystemSession;
17+
import org.eclipse.aether.RepositorySystemSession;
1718
import org.eclipse.aether.SessionData;
1819
import org.eclipse.aether.transfer.TransferListener;
1920

2021

2122
/**
22-
* FilterRepositorySystemSession implementation that allows setting of some/relevant session attributes.
23-
*
24-
* @since 1.4
23+
* A forwarding {@link RepositorySystemSession} implementation that allows overriding specific session attributes.
24+
* <p>
25+
* This class extends {@link org.eclipse.aether.AbstractForwardingRepositorySystemSession} to provide a filtered view
26+
* of a repository system session, allowing selective modification of session properties such as update policy,
27+
* transfer listener, and session data while delegating all other operations to the wrapped session.
28+
* </p>
29+
* <p>
30+
* For mutable properties like {@link TransferListener} and {@link SessionData}, this class attempts to forward
31+
* modifications to the underlying session if it is a {@link DefaultRepositorySystemSession}. If forwarding fails or
32+
* the underlying session is immutable, the values are stored locally and returned by the corresponding getter methods.
33+
* </p>
2534
*/
2635
class FilterRepositorySystemSession extends org.eclipse.aether.AbstractForwardingRepositorySystemSession {
2736

37+
/**
38+
* The custom update policy to override the session's default update policy, or {@code null} to use the session's
39+
* policy.
40+
*/
2841
private final String updatePolicy;
2942

30-
private final DefaultRepositorySystemSession session;
43+
/**
44+
* The underlying repository system session that this instance wraps and delegates to.
45+
*/
46+
private final RepositorySystemSession session;
47+
48+
/**
49+
* The custom transfer listener, or {@code null} if the session's transfer listener should be used.
50+
*/
51+
private TransferListener transferListener;
52+
53+
/**
54+
* The custom session data, or {@code null} if the session's data should be used.
55+
*/
56+
private SessionData data;
3157

32-
public FilterRepositorySystemSession(DefaultRepositorySystemSession session, String updatePolicy) {
58+
/**
59+
* Creates a new filtering repository system session.
60+
*
61+
* @param session the underlying repository system session to wrap
62+
* @param updatePolicy the custom update policy to use, or {@code null} to use the session's default policy
63+
*/
64+
FilterRepositorySystemSession(RepositorySystemSession session, String updatePolicy) {
3365
this.session = session;
3466
this.updatePolicy = updatePolicy;
3567
}
3668

69+
/**
70+
* Returns the update policy for this session.
71+
*
72+
* @return the custom update policy if set, otherwise the policy from the underlying session
73+
*/
3774
@Override
3875
public String getUpdatePolicy() {
3976
return updatePolicy != null ? updatePolicy : super.getUpdatePolicy();
4077
}
4178

42-
public TransferListener setTransferListener(TransferListener transferListener) {
43-
DefaultRepositorySystemSession session = getSession();
44-
TransferListener origTransferListener = session.getTransferListener();
45-
session.setTransferListener(transferListener);
79+
/**
80+
* Returns the transfer listener for this session.
81+
*
82+
* @return the custom transfer listener if set, otherwise the listener from the underlying session
83+
*/
84+
@Override
85+
public TransferListener getTransferListener() {
86+
if(this.transferListener == null) {
87+
// No custom value stored, use the listener from the underlying session
88+
return session.getTransferListener();
89+
}
90+
// Return the custom listener that could not be forwarded to the underlying session
91+
return transferListener;
92+
}
93+
94+
/**
95+
* Returns the session data for this session.
96+
*
97+
* @return the custom session data if set, otherwise the data from the underlying session
98+
*/
99+
@Override
100+
public SessionData getData() {
101+
if(this.data == null) {
102+
// No custom value stored, use the data from the underlying session
103+
return session.getData();
104+
}
105+
// Return the custom data that could not be forwarded to the underlying session
106+
return this.data;
107+
}
108+
109+
/**
110+
* Sets the transfer listener for this session.
111+
* <p>
112+
* This method attempts to forward the transfer listener to the underlying session if it is a
113+
* {@link DefaultRepositorySystemSession}. If the underlying session is immutable or the forwarding fails, the
114+
* listener is stored locally and will be returned by {@link #getTransferListener()}.
115+
* </p>
116+
*
117+
* @param transferListener the transfer listener to set
118+
* @return the previous transfer listener
119+
*/
120+
TransferListener setTransferListener(TransferListener transferListener) {
121+
TransferListener origTransferListener = getTransferListener();
122+
if(session instanceof DefaultRepositorySystemSession def) {
123+
// Attempt to forward to the underlying session if mutable
124+
def.setTransferListener(transferListener);
125+
}
126+
if(transferListener == session.getTransferListener()) {
127+
// Forwarding was successful or the same value already exists in the session, clear local override
128+
this.transferListener = null;
129+
} else {
130+
// Forwarding failed or session is immutable, store locally to return from getter
131+
this.transferListener = transferListener;
132+
}
46133
return origTransferListener;
47134
}
48135

49-
public SessionData setData(SessionData data) {
50-
DefaultRepositorySystemSession session = getSession();
51-
SessionData origSessionData = session.getData();
52-
session.setData(data);
136+
/**
137+
* Sets the session data for this session.
138+
* <p>
139+
* This method attempts to forward the session data to the underlying session if it is a
140+
* {@link DefaultRepositorySystemSession}. If the underlying session is immutable or the forwarding fails, the data
141+
* is stored locally and will be returned by {@link #getData()}.
142+
* </p>
143+
*
144+
* @param data the session data to set
145+
* @return the previous session data
146+
*/
147+
SessionData setData(SessionData data) {
148+
SessionData origSessionData = getData();
149+
if(session instanceof DefaultRepositorySystemSession def) {
150+
// Attempt to forward to the underlying session if mutable
151+
def.setData(data);
152+
}
153+
if(data == session.getData()) {
154+
// Forwarding was successful or the same value already exists in the session, clear local override
155+
this.data = null;
156+
} else {
157+
// Forwarding failed or session is immutable, store locally to return from getter
158+
this.data = data;
159+
}
53160
return origSessionData;
54161
}
55162

163+
/**
164+
* Returns the underlying repository system session that this instance wraps.
165+
*
166+
* @return the wrapped repository system session
167+
*/
56168
@Override
57-
protected DefaultRepositorySystemSession getSession() {
169+
protected RepositorySystemSession getSession() {
58170
return this.session;
59171
}
60172
}

org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import java.util.function.Function;
3333

3434
import org.eclipse.aether.ConfigurationProperties;
35-
import org.eclipse.aether.DefaultRepositorySystemSession;
35+
import org.eclipse.aether.RepositorySystemSession;
3636
import org.eclipse.aether.transfer.TransferListener;
3737
import org.eclipse.core.runtime.CoreException;
3838
import org.eclipse.core.runtime.IProgressMonitor;
@@ -60,7 +60,6 @@
6060
import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator;
6161
import org.apache.maven.lifecycle.internal.MojoExecutor;
6262
import org.apache.maven.plugin.BuildPluginManager;
63-
import org.eclipse.m2e.internal.maven.compat.LifecycleExecutionPlanCalculatorFacade;
6463
import org.apache.maven.plugin.LegacySupport;
6564
import org.apache.maven.plugin.MojoExecution;
6665
import org.apache.maven.project.DefaultProjectBuildingRequest;
@@ -79,6 +78,7 @@
7978
import org.eclipse.m2e.core.embedder.MavenSettingsLocations;
8079
import org.eclipse.m2e.core.internal.MavenPluginActivator;
8180
import org.eclipse.m2e.core.internal.Messages;
81+
import org.eclipse.m2e.internal.maven.compat.LifecycleExecutionPlanCalculatorFacade;
8282
import org.eclipse.m2e.internal.maven.compat.ReadonlyMavenExecutionRequest;
8383

8484

@@ -593,7 +593,7 @@ public IComponentLookup getComponentLookup() {
593593

594594
static FilterRepositorySystemSession createRepositorySession(MavenExecutionRequest request,
595595
IMavenConfiguration configuration, IComponentLookup lookup) throws CoreException {
596-
DefaultRepositorySystemSession session = (DefaultRepositorySystemSession) ((DefaultMaven) lookup
596+
RepositorySystemSession session = ((DefaultMaven) lookup
597597
.lookup(Maven.class)).newRepositorySession(request);
598598
String updatePolicy = configuration.getGlobalUpdatePolicy();
599599
return new FilterRepositorySystemSession(session, request.isUpdateSnapshots() ? null : updatePolicy);

org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenProjectMutableState.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,25 @@ public void restore(MavenProject project) {
7070
setElements(project.getTestResources(), testResources);
7171

7272
if(properties != null) {
73-
project.getProperties().clear();
74-
project.getProperties().putAll(properties);
73+
try {
74+
project.getProperties().clear();
75+
project.getProperties().putAll(properties);
76+
} catch(UnsupportedOperationException e) {
77+
//if the collection itself is immutable then we do not need to restore a snapshot because it can not be altered anyways!
78+
}
7579
}
7680

7781
project.setContextValue(CTX_SNAPSHOT, null);
7882
}
7983

8084
private <T> void setElements(List<T> collection, List<T> elements) {
81-
if(elements != null) {
82-
collection.clear();
83-
collection.addAll(elements);
85+
try {
86+
if(elements != null) {
87+
collection.clear();
88+
collection.addAll(elements);
89+
}
90+
} catch(UnsupportedOperationException e) {
91+
//if the collection itself is immutable then we do not need to restore a snapshot because it can not be altered anyways!
8492
}
8593
}
8694

0 commit comments

Comments
 (0)