Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace aether-okhttp-connector with Maven's wagon-http #1513

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@

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).

### Dropped aether-okhttp-connector

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.

However, the usage of this alternative connector introduced certain inconsistencies when compared to regular Maven CLI builds.
These discrepancies, often revolving around matters of authentication and proxies, posed challenges.
Maven 3.x significantly improved its resolver implementations, largely mitigating the advantages of `aether-okhttp-connector` and bringing new features.
This shift left the `aether-okhttp-connector` outdated and that project has now been abandoned.

m2e 2.4 has been adjusted to better align with the Maven 3.9 runtime.
This adjustment is expected to result in fewer issues pertaining to artifact resolution and proxy authentication.
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.

## 2.4.0

* 📅 Release Date: 29th August 2023
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
HannesWell marked this conversation as resolved.
Show resolved Hide resolved
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
2 changes: 1 addition & 1 deletion org.eclipse.m2e.editor.lemminx.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Require-Bundle: org.junit,
org.eclipse.ui.ide,
org.eclipse.core.resources,
org.eclipse.ui.workbench.texteditor,
org.eclipse.core.runtime,
org.eclipse.m2e.maven.runtime;bundle-version="[3.9.400,4.0.0)",
org.eclipse.ui.tests.harness,
org.eclipse.jface.text,
org.eclipse.m2e.core.ui,
Expand Down
1 change: 1 addition & 0 deletions org.eclipse.m2e.feature/forceQualifierUpdate.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# To force a version qualifier update add the bug here
Update build-qualifier because maven-runtime version update to Maven 3.9.5
Update build-qualifier because maven-runtime dropped aether-okhttp-connector
43 changes: 28 additions & 15 deletions org.eclipse.m2e.maven.runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@
bundle. So make sure the following variable has the value of the maven-resolver-* jars
https://bugs.eclipse.org/bugs/show_bug.cgi?id=529540 -->
<maven-resolver.version>1.9.16</maven-resolver.version>
<apache-commons-codec.version>1.16.0</apache-commons-codec.version><!-- Keep in sync with what maven includes-->
<!-- below are m2e-specific addons -->
<plexus-build-api.version>0.0.7</plexus-build-api.version>
<okhttp-connector.version>0.17.8</okhttp-connector.version>
<jars.directory>target/jars</jars.directory>
<outputDirectory.sources>${project.build.directory}/classes-source</outputDirectory.sources>
<failIfMacSigningFailed>false</failIfMacSigningFailed>
<buildqualifier.format>%Y%m%d-%H%M</buildqualifier.format>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down Expand Up @@ -78,17 +77,6 @@
<artifactId>plexus-build-api</artifactId>
<version>${plexus-build-api.version}</version>
</dependency>
<dependency>
<groupId>io.takari.aether</groupId>
<artifactId>aether-connector-okhttp</artifactId>
<version>${okhttp-connector.version}</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId>
Expand All @@ -101,6 +89,18 @@
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-wagon</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-file</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
Expand Down Expand Up @@ -140,6 +140,17 @@
<version>2.0.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${apache-commons-codec.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
Expand Down Expand Up @@ -192,14 +203,16 @@
org.sonatype.plexus.*;provider=m2e;mandatory:=provider,\
org.eclipse.aether.*;provider=m2e;mandatory:=provider;version=${maven-resolver.version},\
com.google.inject.*;provider=m2e;mandatory:=provider,\
io.takari.*;provider=m2e;mandatory:=provider,\
fbricon marked this conversation as resolved.
Show resolved Hide resolved
org.apache.maven.wagon.*;provider=m2e;mandatory:=provider,\
org.eclipse.sisu.*;provider=m2e;mandatory:=provider;version=${maven-resolver.version}
Import-Package: \
org.slf4j;version="[1.7.31,3.0.0)",\
org.slf4j.*;version="[1.7.31,3.0.0)",\
javax.inject;version="[1.0.0,2.0.0)",\
javax.annotation;version="[1.2.0,2.0.0)", \
org.apache.commons.cli;version="[1.4.0,2.0.0)"
org.apache.commons.cli;version="[1.4.0,2.0.0)", \
org.apache.commons.codec*, \
org.apache.commons.lang3*
Require-Bundle: \
com.google.guava;bundle-version="32.0.1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@
import org.apache.maven.wagon.authentication.AuthenticationException;
import org.apache.maven.wagon.authentication.AuthenticationInfo;
import org.apache.maven.wagon.authorization.AuthorizationException;
import org.apache.maven.wagon.providers.http.HttpWagon;
import org.apache.maven.wagon.proxy.ProxyInfoProvider;
import org.apache.maven.wagon.repository.Repository;
import org.apache.maven.wagon.resource.Resource;

import io.takari.aether.wagon.OkHttpsWagon;


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

//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.
static String PROTOCOL = "httx";
Expand Down
12 changes: 12 additions & 0 deletions target-platform/target-platform.target
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@
<version>1.6.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.16.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.13.0</version>
<type>jar</type>
</dependency>
</dependencies>
</location>
<location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="false" label="M2E Workspace CLI" missingManifest="error" type="Maven">
Expand Down
Loading