Skip to content

Commit f5e9cdc

Browse files
EskibearHannesWell
andcommitted
[Runtime] Embed Maven 3.9.1
Co-authored-by: Hannes Wellmann <[email protected]> Signed-off-by: Yan Zhang <[email protected]>
1 parent 43bba83 commit f5e9cdc

File tree

12 files changed

+62
-48
lines changed

12 files changed

+62
-48
lines changed

RELEASE_NOTES.md

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

3+
## 2.3.0
4+
5+
* 📅 Release Date: _expected_ May 2023
6+
7+
### Embedded and use Maven 3.9.1
8+
9+
Updated the embedded Maven from version 3.8.7 to 3.9.1; [Maven 3.9.1 Release Notes](https://maven.apache.org/docs/3.9.1/release-notes.html).
10+
311
## 2.2.1
412

513
* 📅 Release Date: 7th March 2023
@@ -21,7 +29,7 @@ Previously, to participate in the incremental maven build it was necessary to
2129
This often leads to a poor user experience and we think that users are adding mojos on purpose because they perform valuable tasks.
2230

2331
Because of this, M2E now automatically enables the execution of mojos if there is no mapping configured. In case you want to change this there is a new configuration option to control the behavior:
24-
![grafik](https://user-images.githubusercontent.com/1331477/211298610-0fa92418-246a-4377-913a-60d02d63013b.png)
32+
![grafik](https://user-images.githubusercontent.com/1331477/211298610-0fa92418-246a-4377-913a-60d02d63013b.png)
2533

2634
### Updated Dependency Editor
2735

@@ -41,7 +49,7 @@ https://maven.apache.org/surefire/maven-surefire-plugin/examples/skipping-tests.
4149

4250
### Configuration of Maven Execution JRE
4351

44-
In the past, the project's build JRE was also used by default to execute Maven itself.
52+
In the past, the project's build JRE was also used by default to execute Maven itself.
4553
Now the default Java version for executing Maven is determined from the configuration of the `maven-enforcer-plugin` rule [`requireJavaVersion`](https://maven.apache.org/enforcer/enforcer-rules/requireJavaVersion.html) when creating or updating the Maven configuration. This value is no longer considered for configuring the project's build JRE.
4654
In case this plugin configuration is not found, M2E falls back to either the project's build JRE or the workspace's default JRE.
4755

@@ -70,7 +78,7 @@ The connector for the `bnd-maven-plugin` and `maven-bundle-plugin`, which is inc
7078

7179
The M2E Maven-Console now also supports tracking of so called _polyglot_ Maven-projects. Those are projects that don't have a standard `pom.xml` and whose Maven-model is instead created from another source. One prominent example in the Eclipse world are Eclipse-PDE projects that are build with Tycho(-pomless).
7280

73-
Due to this new support, polyglot Maven projects now also benefit from the
81+
Due to this new support, polyglot Maven projects now also benefit from the
7482
[Improved links to JUnit test-reports and project file in the Console](https://github.com/eclipse-m2e/m2e-core/blob/master/RELEASE_NOTES.md#improved-links-to-junit-test-reports-and-project-pomxml-in-the-console-of-a-maven-build)
7583
as well as the capability to
7684
[Automatically launch and attach Remote-Application-Debugger when Maven plug-in starts a forked JVM that waits for a debugger](https://github.com/eclipse-m2e/m2e-core/blob/master/RELEASE_NOTES.md#automatically-launch-and-attach-remote-application-debugger-when-maven-plug-in-starts-a-forked-jvm-that-waits-for-a-debugger) introduced in previous releases.

m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
</parent>
2020

2121
<artifactId>org.eclipse.m2e.maven.runtime</artifactId>
22-
<version>3.8.701-SNAPSHOT</version>
22+
<version>3.9.100-SNAPSHOT</version>
2323
<packaging>jar</packaging>
2424

2525
<name>M2E Embedded Maven Runtime (includes Incubating components)</name>
2626

2727
<properties>
2828
<!-- maven core version -->
29-
<maven-core.version>3.8.7</maven-core.version>
29+
<maven-core.version>3.9.1</maven-core.version>
3030
<!-- NOTE: When maven-core.version changes, this may impact the versions of the maven-resolver-*
3131
jars that export the org.eclipse.aether.* packages in the org.eclipse.m2e.maven.runtime
3232
bundle. So make sure the following variable has the value of the maven-resolver-* jars
3333
https://bugs.eclipse.org/bugs/show_bug.cgi?id=529540 -->
34-
<maven-resolver.version>1.6.3</maven-resolver.version>
34+
<maven-resolver.version>1.9.7</maven-resolver.version>
3535
<!-- below are m2e-specific addons -->
3636
<plexus-build-api.version>0.0.7</plexus-build-api.version>
3737
<okhttp-connector.version>0.17.8</okhttp-connector.version>
@@ -52,10 +52,6 @@
5252
<groupId>org.checkerframework</groupId>
5353
<artifactId>checker-compat-qual</artifactId>
5454
</exclusion>
55-
<exclusion>
56-
<groupId>aopalliance</groupId>
57-
<artifactId>aopalliance</artifactId>
58-
</exclusion>
5955
</exclusions>
6056
</dependency>
6157
<dependency>
@@ -156,8 +152,8 @@
156152
<configuration>
157153
<bnd><![CDATA[
158154
# When launching a Maven build using this embedded runtime, we want the embedded SLF4J logger binding to be used.
159-
# However when the this Maven runtime is used within the Eclipse-IDE(-JVM) we don't want it to use the embedded SLF4J-binding
160-
# but instead use the SLF4J-binding provided by the Eclipse runtime. This is achived by making the embedded SLF4J-binding invisible
155+
# However when the this Maven runtime is used within the Eclipse-IDE(-JVM) we don't want it to use the embedded SLF4J-binding
156+
# but instead use the SLF4J-binding provided by the Eclipse runtime. This is achived by making the embedded SLF4J-binding invisible
161157
# for OSGi, by simply NOT placing the binding's jar on the Bundle-ClassPath.
162158
slf4jBinding=maven-slf4j-provider-${maven-core.version}.jar
163159
M2E-SLF4JBinding=jars/${slf4jBinding}
@@ -185,7 +181,7 @@
185181
Require-Bundle: \
186182
com.google.guava
187183
]]></bnd>
188-
<!-- All direct dependencies specified as Require-Bundle or Import-package are added to the classpath of a launched
184+
<!-- All direct dependencies specified as Require-Bundle or Import-package are added to the classpath of a launched
189185
Maven-Build-JVM. See MavenEmbeddedRuntime for details. -->
190186
</configuration>
191187
</plugin>

org.eclipse.m2e.core.ui.tests/resources/projects/simple.projectWithJUnit-5_Test/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@
2323
<plugins>
2424
<plugin>
2525
<artifactId>maven-surefire-plugin</artifactId>
26-
<version>2.22.2</version>
26+
<version>3.0.0</version>
27+
<configuration>
28+
<trimStackTrace>true</trimStackTrace>
29+
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
30+
</configuration>
2731
</plugin>
2832
</plugins>
2933
</pluginManagement>
3034
</build>
31-
</project>
35+
</project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# To force a version qualifier update add the bug here
22
Update build-qualifier because the compiled byte-code has changed, probably due to newer JDK minor version used in the CI
3+
Last update: Wed Mar 22 15:45:13 CST 2023

org.eclipse.m2e.feature/feature.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<feature
33
id="org.eclipse.m2e.feature"
44
label="%featureName"
5-
version="2.2.2.qualifier"
5+
version="2.3.0.qualifier"
66
provider-name="%providerName"
77
plugin="org.eclipse.m2e.core"
88
license-feature="org.eclipse.license"

org.eclipse.m2e.launching/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.launching;singleton:=true
5-
Bundle-Version: 2.0.400.qualifier
5+
Bundle-Version: 2.0.500.qualifier
66
Bundle-Localization: plugin
77
Require-Bundle: org.eclipse.core.runtime,
88
org.eclipse.core.variables,

org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package org.eclipse.m2e.internal.launch;
1616

1717
import java.io.IOException;
18+
import java.net.URI;
1819
import java.nio.file.Files;
1920
import java.nio.file.Path;
2021
import java.util.ArrayDeque;
@@ -109,7 +110,7 @@ private static record ProjectReference(IProject project, MavenProjectBuildData b
109110

110111
private ProjectReference mavenProject;
111112

112-
private final Deque<IRegion> projectDefinitionLines = new ArrayDeque<>(2);
113+
private final Deque<IRegion> projectDefinitionLines = new ArrayDeque<>(3);
113114

114115
private final List<int[]> removedLineLocations = new ArrayList<>();
115116

@@ -190,42 +191,47 @@ private boolean isMavenProcess(ILaunchConfiguration launchConfiguration) {
190191

191192
private static final int VERSION = 1;
192193

194+
private static final Pattern FROM_FILE_LINE = Pattern.compile("^\\[INFO\\] +from ");
195+
193196
private static final Pattern PACKAGING_TYPE_LINE = Pattern.compile("^\\[INFO\\] -+\\[ [\\w\\-\\. ]+ \\]-+$");
194197

195198
private String getText(IRegion lineRegion) throws BadLocationException {
196199
removedLineLocations.clear();
197200
String line0 = getLineText(lineRegion, removedLineLocations);
198201

199-
if(projectDefinitionLines.size() < 2) {
202+
if(projectDefinitionLines.size() < 3) {
200203
projectDefinitionLines.add(lineRegion);
201204
return line0;
202205
}
203206
// Read groupId, artifactId and version from a sequence like the following lines:
204207
// [INFO] -----------< org.eclipse.m2e:org.eclipse.m2e.maven.runtime >------------
205208
// [INFO] Building M2E Embedded Maven Runtime (includes Incubating components) 1.18.2-SNAPSHOT [4/5]
209+
// [INFO] from pom.xml
206210
// [INFO] ---------------------------[ eclipse-plugin ]---------------------------
207211

208212
if(PACKAGING_TYPE_LINE.matcher(line0).matches()) {
209213
Iterator<IRegion> previousLines = projectDefinitionLines.descendingIterator();
210214

211-
IRegion line1Region = previousLines.next();
212-
String line1 = getLineText(line1Region, null);
213-
214-
Matcher vMatcher = VERSION_LINE.matcher(line1);
215-
if(vMatcher.matches()) {
216-
String version = vMatcher.group(VERSION);
217-
218-
IRegion line2Region = previousLines.next();
219-
List<int[]> removedLine2Locations = new ArrayList<>();
220-
String line2 = getLineText(line2Region, removedLine2Locations);
221-
Matcher gaMatcher = GROUP_ARTIFACT_LINE.matcher(line2);
222-
if(gaMatcher.matches()) {
223-
String groupId = gaMatcher.group(GROUP_ID);
224-
String artifactId = gaMatcher.group(ARTIFACT_ID);
225-
226-
mavenProject = getProject(groupId, artifactId, version);
227-
if(mavenProject != null) {
228-
addProjectLink(line2Region, gaMatcher, GROUP_ID, ARTIFACT_ID, removedLine2Locations);
215+
String line1 = getLineText(previousLines.next(), null);
216+
if(FROM_FILE_LINE.matcher(line1).find()) {
217+
218+
String line2 = getLineText(previousLines.next(), null);
219+
Matcher vMatcher = VERSION_LINE.matcher(line2);
220+
if(vMatcher.matches()) {
221+
String version = vMatcher.group(VERSION);
222+
223+
IRegion line3Region = previousLines.next();
224+
List<int[]> removedLine3Locations = new ArrayList<>();
225+
String line3 = getLineText(line3Region, removedLine3Locations);
226+
Matcher gaMatcher = GROUP_ARTIFACT_LINE.matcher(line3);
227+
if(gaMatcher.matches()) {
228+
String groupId = gaMatcher.group(GROUP_ID);
229+
String artifactId = gaMatcher.group(ARTIFACT_ID);
230+
231+
mavenProject = getProject(groupId, artifactId, version);
232+
if(mavenProject != null) {
233+
addProjectLink(line3Region, gaMatcher, GROUP_ID, ARTIFACT_ID, removedLine3Locations);
234+
}
229235
}
230236
}
231237
}
@@ -265,9 +271,9 @@ private ProjectReference getProject(String groupId, String artifactId, String ve
265271
if(buildProject == null) {
266272
return null;
267273
}
268-
Optional<IProject> project = Arrays
269-
.stream(
270-
ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI(buildProject.projectBasedir.toUri()))
274+
IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
275+
URI basedirURI = buildProject.projectBasedir.toUri();
276+
Optional<IProject> project = Arrays.stream(wsRoot.findContainersForLocationURI(basedirURI))
271277
.filter(IProject.class::isInstance).map(IProject.class::cast).findFirst();
272278
//if project is absent, the project build in Maven is not in the workspace
273279
return project.isPresent() ? new ProjectReference(project.get(), buildProject) : null;

org.eclipse.m2e.mavenarchiver/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: m2e connector for the mavenarchiver and pom properties
44
Bundle-SymbolicName: org.eclipse.m2e.mavenarchiver;singleton:=true
5-
Bundle-Version: 2.0.300.qualifier
5+
Bundle-Version: 2.0.400.qualifier
66
Bundle-Vendor: Eclipse.org - m2e
77
Bundle-RequiredExecutionEnvironment: JavaSE-17
88
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",

org.eclipse.m2e.mavenarchiver/src/org/eclipse/m2e/mavenarchiver/internal/AbstractMavenArchiverConfigurator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
package org.eclipse.m2e.mavenarchiver.internal;
1212

1313
import java.io.File;
14-
import java.io.FileNotFoundException;
1514
import java.io.FileReader;
1615
import java.io.IOException;
1716
import java.io.InputStream;
@@ -466,7 +465,7 @@ private void reflectManifestGeneration(IMavenProjectFacade facade, MojoExecution
466465
}
467466

468467
private void writeManifest(File manifestFile, Object manifest) throws UnsupportedEncodingException,
469-
FileNotFoundException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
468+
IllegalAccessException, IllegalArgumentException, InvocationTargetException, IOException {
470469
Method write = getWriteMethod(manifest);
471470
if (write != null) {
472471
try (PrintWriter printWriter = new PrintWriter(

0 commit comments

Comments
 (0)