Skip to content

Commit 419b502

Browse files
fbriconHannesWell
andcommitted
[Maven-Runtime] Replace aether-okhttp-connector with Maven's wagon-http
Co-authored-by: Hannes Wellmann <[email protected]>
1 parent 43425f1 commit 419b502

File tree

7 files changed

+66
-19
lines changed

7 files changed

+66
-19
lines changed

RELEASE_NOTES.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@
88

99
Updated the embedded Maven from version 3.9.4 to 3.9.5; [Maven 3.9.5 Release Notes](https://maven.apache.org/docs/3.9.5/release-notes.html).
1010

11+
### Dropped aether-okhttp-connector
12+
13+
Previously, m2e embedded [`aether-okhttp-connector`](https://github.com/takari/aether-connector-okhttp), an alternative to Wagon HTTP connector, based on [OkHttp](https://square.github.io/okhttp/), which was developed at a time when Maven 2's HTTP Connector didn't leverage HTTP/2 and parallel downloads.
14+
15+
However, the usage of this alternative connector introduced certain inconsistencies when compared to regular Maven CLI builds.
16+
These discrepancies, often revolving around matters of authentication and proxies, posed challenges.
17+
Maven 3.x significantly improved its resolver implementations, largely mitigating the advantages of `aether-okhttp-connector` and bringing new features.
18+
This shift left the `aether-okhttp-connector` outdated and that project has now been abandoned.
19+
20+
m2e 2.4 has been adjusted to better align with the Maven 3.9 runtime.
21+
This adjustment is expected to result in fewer issues pertaining to artifact resolution and proxy authentication.
22+
However, due to its removal from the runtime, there exists a potential risk that third-party Plug-ins dependent on m2e's integrated `OkHttp` functionality might experience disruptions.
23+
1124
## 2.4.0
1225

1326
* 📅 Release Date: 29th August 2023
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
3+
org.eclipse.jdt.core.compiler.compliance=17
4+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
5+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
6+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
8+
org.eclipse.jdt.core.compiler.release=enabled
9+
org.eclipse.jdt.core.compiler.source=17

org.eclipse.m2e.editor.lemminx.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Require-Bundle: org.junit,
1212
org.eclipse.ui.ide,
1313
org.eclipse.core.resources,
1414
org.eclipse.ui.workbench.texteditor,
15-
org.eclipse.core.runtime,
15+
org.eclipse.m2e.maven.runtime;bundle-version="[3.9.400,4.0.0)",
1616
org.eclipse.ui.tests.harness,
1717
org.eclipse.jface.text,
1818
org.eclipse.m2e.core.ui,
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 maven-runtime version update to Maven 3.9.5
3+
Update build-qualifier because maven-runtime dropped aether-okhttp-connector

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

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@
3333
bundle. So make sure the following variable has the value of the maven-resolver-* jars
3434
https://bugs.eclipse.org/bugs/show_bug.cgi?id=529540 -->
3535
<maven-resolver.version>1.9.16</maven-resolver.version>
36+
<apache-commons-codec.version>1.16.0</apache-commons-codec.version><!-- Keep in sync with what maven includes-->
3637
<!-- below are m2e-specific addons -->
3738
<plexus-build-api.version>0.0.7</plexus-build-api.version>
38-
<okhttp-connector.version>0.17.8</okhttp-connector.version>
3939
<jars.directory>target/jars</jars.directory>
4040
<outputDirectory.sources>${project.build.directory}/classes-source</outputDirectory.sources>
4141
<failIfMacSigningFailed>false</failIfMacSigningFailed>
4242
<buildqualifier.format>%Y%m%d-%H%M</buildqualifier.format>
4343
</properties>
44-
4544
<dependencies>
4645
<dependency>
4746
<groupId>org.apache.maven</groupId>
@@ -78,17 +77,6 @@
7877
<artifactId>plexus-build-api</artifactId>
7978
<version>${plexus-build-api.version}</version>
8079
</dependency>
81-
<dependency>
82-
<groupId>io.takari.aether</groupId>
83-
<artifactId>aether-connector-okhttp</artifactId>
84-
<version>${okhttp-connector.version}</version>
85-
<exclusions>
86-
<exclusion>
87-
<groupId>org.eclipse.aether</groupId>
88-
<artifactId>aether-util</artifactId>
89-
</exclusion>
90-
</exclusions>
91-
</dependency>
9280
<dependency>
9381
<groupId>org.apache.maven.resolver</groupId>
9482
<artifactId>maven-resolver-impl</artifactId>
@@ -101,6 +89,18 @@
10189
<groupId>org.apache.maven.resolver</groupId>
10290
<artifactId>maven-resolver-transport-wagon</artifactId>
10391
</dependency>
92+
<dependency>
93+
<groupId>org.apache.maven.resolver</groupId>
94+
<artifactId>maven-resolver-transport-file</artifactId>
95+
</dependency>
96+
<dependency>
97+
<groupId>org.apache.maven.resolver</groupId>
98+
<artifactId>maven-resolver-transport-http</artifactId>
99+
</dependency>
100+
<dependency>
101+
<groupId>org.apache.maven.wagon</groupId>
102+
<artifactId>wagon-http</artifactId>
103+
</dependency>
104104
<dependency>
105105
<groupId>org.apache.maven.wagon</groupId>
106106
<artifactId>wagon-file</artifactId>
@@ -140,6 +140,17 @@
140140
<version>2.0.7</version>
141141
<scope>provided</scope>
142142
</dependency>
143+
<dependency>
144+
<groupId>commons-codec</groupId>
145+
<artifactId>commons-codec</artifactId>
146+
<version>${apache-commons-codec.version}</version>
147+
<scope>provided</scope>
148+
</dependency>
149+
<dependency>
150+
<groupId>org.apache.commons</groupId>
151+
<artifactId>commons-lang3</artifactId>
152+
<scope>provided</scope>
153+
</dependency>
143154
<dependency>
144155
<groupId>javax.annotation</groupId>
145156
<artifactId>javax.annotation-api</artifactId>
@@ -192,14 +203,16 @@
192203
org.sonatype.plexus.*;provider=m2e;mandatory:=provider,\
193204
org.eclipse.aether.*;provider=m2e;mandatory:=provider;version=${maven-resolver.version},\
194205
com.google.inject.*;provider=m2e;mandatory:=provider,\
195-
io.takari.*;provider=m2e;mandatory:=provider,\
206+
org.apache.maven.wagon.*;provider=m2e;mandatory:=provider,\
196207
org.eclipse.sisu.*;provider=m2e;mandatory:=provider;version=${maven-resolver.version}
197208
Import-Package: \
198209
org.slf4j;version="[1.7.31,3.0.0)",\
199210
org.slf4j.*;version="[1.7.31,3.0.0)",\
200211
javax.inject;version="[1.0.0,2.0.0)",\
201212
javax.annotation;version="[1.2.0,2.0.0)", \
202-
org.apache.commons.cli;version="[1.4.0,2.0.0)"
213+
org.apache.commons.cli;version="[1.4.0,2.0.0)", \
214+
org.apache.commons.codec*, \
215+
org.apache.commons.lang3*
203216
Require-Bundle: \
204217
com.google.guava;bundle-version="32.0.1"
205218

org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/HttxWagon.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,18 @@
2525
import org.apache.maven.wagon.authentication.AuthenticationException;
2626
import org.apache.maven.wagon.authentication.AuthenticationInfo;
2727
import org.apache.maven.wagon.authorization.AuthorizationException;
28+
import org.apache.maven.wagon.providers.http.HttpWagon;
2829
import org.apache.maven.wagon.proxy.ProxyInfoProvider;
2930
import org.apache.maven.wagon.repository.Repository;
3031
import org.apache.maven.wagon.resource.Resource;
3132

32-
import io.takari.aether.wagon.OkHttpsWagon;
33-
3433

3534
/**
3635
* A special wagon for testing that allows to record the requests made to a repository. Use
3736
* {@link #setRequestFilterPattern(String, boolean)} to configure what to record and to optionally clear previous
3837
* records. The repository URL to use with this wagon looks like {@code httx://localhost/<path-relative-to-project>}.
3938
*/
40-
public class HttxWagon extends OkHttpsWagon {
39+
public class HttxWagon extends HttpWagon {
4140

4241
//MUST NOT start with "http", because otherwise the io.takari.aether.connector.AetherRepositoryConnector will consider it as default http(s) and will handle the connection.
4342
static String PROTOCOL = "httx";

target-platform/target-platform.target

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@
100100
<version>1.6.0</version>
101101
<type>jar</type>
102102
</dependency>
103+
<dependency>
104+
<groupId>commons-codec</groupId>
105+
<artifactId>commons-codec</artifactId>
106+
<version>1.16.0</version>
107+
<type>jar</type>
108+
</dependency>
109+
<dependency>
110+
<groupId>org.apache.commons</groupId>
111+
<artifactId>commons-lang3</artifactId>
112+
<version>3.13.0</version>
113+
<type>jar</type>
114+
</dependency>
103115
</dependencies>
104116
</location>
105117
<location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="false" label="M2E Workspace CLI" missingManifest="error" type="Maven">

0 commit comments

Comments
 (0)