-
Notifications
You must be signed in to change notification settings - Fork 115
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
Drop aether-connector-okhttp dependency #1510
Comments
@fbricon please just make sure that this works on Maven 3.8.x and Maven 3.9.x some of the "deprecated" maven features sadly don't play well with older maven versions see here for testing support of maven 3.8.x: |
Can you tell what needs to be changed in the code of m2e to accomplish this goal? If I search the code base for |
We probably just need to replace okhttp connector with a maven-resolver-transport-http, then fix the HttxWagon, which acts like a spy, to get rid of Okhttp. But I can't figure out how m2e works these days.
What happened to workspace project resolution? |
The In case you wondered why a 3.8.X is present, it is also contained in the TP to allow users to install older version of the maven-runtime since the jump from 3.8 to 3.9 seems to be not trivial for some users. But you have to ask Christoph if you need details. |
Btw. do you know if there is an equivalent for |
no I'm not familiar with that part at all. Maybe @cstamas might know |
looks like triggering a runtime project build is the key. For the Httpx class, I just replaced OkHttpsWagon with Maven's HttpWagon. See #1513 |
So, Wagon was Maven2 abstraction for various transports (file. http, ssh etc). Since Maven3 and introduction of Aether/MavenResolver the resolver itself carries the "transport api" and provides 3 implementations: classpath, file and http (using Apache HttpClient 4.x). Also, there is an adapter, that adapts Wagon to "transport api", but again, Wagon API is legacy, and IMHO should not be used anymore (at least in resolving). It just adds anoher ton (to existing) abstraction layers to transport, that literally becomes rather impediment than anything else... |
The upcoming Aether/Resolver version 2.0.0 will contain new tranports to enable HTTP/2, and OkHttp was considered but dropped (as it uderperformed), see here apache/maven-resolver#231 |
Thanks Tamas. Do you have some pointers how to use the suggested APIs explicitly? @fbricon could you consider this? As far as I understand it, this would mean we don't have to add any jar to the embedded maven-runtime and would only adapt the tests. But I think this would be a good template for downstream consumers of m2e.
Resolver 2.0 will not be used for Maven 3.9, will it? |
Resolver vs Maven versions:
See this thread on ML https://lists.apache.org/thread/g5m53q2qfqf8py4nyr3mf00vb4o9rmj1 |
Um, use for what? I mean, resolver "transport api" implementations are picked up by resolver and used during fetching of remote artifacts... What "explicit use" you have on your mind? Note that unlike Wagon, that attempted to be "transport swiss army knife", resolver "transport api" is not trying that. Still, it can be used outside of resolver for some simpler "get me that URL" cases, as done for example in Maven 4 transport API: |
The transports in resolver are selected (if protocol "conflicts" like HTTP is, that offers at least 2 transport implementations) in following manner:
Also, check out this page https://maven.apache.org/guides/mini/guide-resolver-transport.html |
From the @fbricon screenshot, to get rid of Wagon: REMOVE:
ADD:
And that should do it (unless there is some more code that somehow "forces" use of Wagon which am unaware of). |
m2e currently brings an old okhttp version (as seen in redhat-developer/vscode-java#3245), because of aether-connector-okhttp. That extension having been iced, m2e should drop it, and use the same http resolver as maven.
This will probably fix #250 as well.
Either I or someone else from Red Hat will take a stab at it
The text was updated successfully, but these errors were encountered: