takari / aether-connector-okhttp Goto Github PK
View Code? Open in Web Editor NEWA repository connector implementation based on Square's OkHttp.
License: Other
A repository connector implementation based on Square's OkHttp.
License: Other
We failed to catch the issue earlier, as our tests reused locally cached data, but when a remote repository uses TLSv1, the connector fails to connect, as TLSv1 support was removed from OkHttp 3.13.0
junit.framework.AssertionFailedError: expected:<Optional.empty> but was:<Optional[Marker [on: /invalidParent/pom.xml, id: 30, type: org.eclipse.m2e.core.maven2Problem.pomloading, attributes: [columnEnd: 9, columnStart: 1, lineNumber: 3, message: Project build error: Non-resolvable parent POM for org.eclipse.m2e.tests.invalidParent:invalidParent:1: Could not transfer artifact io.takari:takari:pom:28 from/to eclipse.maven.central.mirror (https://repo.eclipse.org/content/repositories/maven_central/): Server chose TLSv1, but that protocol version is not enabled or not supported by the client. and 'parent.relativePath' points at wrong local POM, severity: 2, transient: false], created: 5/28/19 6:43 PM]]> at org.eclipse.m2e.core.internal.project.registry.RegistryTest.testInvalidParent(RegistryTest.java:90)
Should be fixable by enabling the protocols on the client
OkHttpClient client = new OkHttpClient.Builder()
.connectionSpecs(Arrays.asList(ConnectionSpec.COMPATIBLE_TLS))
.build();
I'm investigating some jar file corruption occurring in my .m2 when using Eclipse's m2e plugin to import Maven projects.
Usually a jar file, that is larger than the original jar is saved in the .m2 folder. But sometimes the jar file is 0 bytes, other times, it smaller than the actual jar. Besides jars, pom.xmls are often getting corrupted too.
Checking the sha1 shows that the file is indeed corrupt.
This causing both Eclipse build, and later actual Maven build to fail for variety of reasons, like:
These are especially hard bugs to find.
More details in the Eclipse bugs:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=534228
https://bugs.eclipse.org/bugs/show_bug.cgi?id=514691
I have made an integration test that shows the the corruption reliably, you can find it here:
master...helospark:concurrency-test
This test simulates an Artifactory interaction with aether-connection, without actual remote calls.
Starts a few threads that are trying to download the same file.
It retries the test 10 times, to make sure the concurrency issues are shown.
The cause is the "resume download" feature built into the connector. Based on some debugging the following happens:
As long as the tmp files are always deleted (or not using during init), I don't think, we have to worry about these so much, because the likelihood of this causing an issue seems small, and a retry solves it.
Hi,
After making one our projects use aether-connector-okhttp
as a core extension, we realized mvn deploy:deploy-file
started facing Checksum validation failed
issues. By increasing the number of retries, the deployment eventually succeeds, which leads to suspect a race condition somewhere.
Here's an (anonymized) maven output:
...
[INFO] --- maven-deploy-plugin:2.8.2:deploy-file (default) @ my-project ---
[INFO] Uploading to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.zip
[INFO] Uploaded to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.zip (1.2 MB at 191 kB/s)
[INFO] Uploading to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.pom
[INFO] Uploaded to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.pom (455 B at 1.8 kB/s)
[INFO] Downloading from : https://artifactory.my-domain/my-path/my-project/maven-metadata.xml
[WARNING] Checksum validation failed: Checksum validation failed, expected faf34f17acf90e006c7078f43af8e16c454bb08a but is a101752c30e45f96aa41d6599629999676500721 from for https://artifactory.my-domain/my-path/my-project/maven-metadata.xml
[WARNING] Could not transfer metadata my.group.id:my-project/maven-metadata.xml from/to my-repo-id (https://artifactory.my-domain): Checksum validation failed: Checksum validation failed, expected faf34f17acf90e006c7078f43af8e16c454bb08a but is a101752c30e45f96aa41d6599629999676500721
[WARNING] Encountered issue during deployment: Failed to retrieve remote metadata my.group.id:my-project/maven-metadata.xml: Could not transfer metadata my.group.id:my-project/maven-metadata.xml from/to my-repo-id (https://artifactory.my-domain): Checksum validation failed: Checksum validation failed, expected faf34f17acf90e006c7078f43af8e16c454bb08a but is a101752c30e45f96aa41d6599629999676500721
[INFO] Retrying deployment attempt 2 of 10
[INFO] Uploading to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.zip
[INFO] Uploaded to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.zip (590 kB at 3.6 MB/s)
[INFO] Uploading to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.pom
[INFO] Uploaded to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.pom (455 B at 3.6 kB/s)
[INFO] Downloading from : https://artifactory.my-domain/my-path/my-project/maven-metadata.xml
[WARNING] Checksum validation failed: Checksum validation failed, expected 735e6640ca292ee83b39e7604446dbe03df20202 but is faf34f17acf90e006c7078f43af8e16c454bb08a from for https://artifactory.my-domain/my-path/my-project/maven-metadata.xml
[WARNING] Could not transfer metadata my.group.id:my-project/maven-metadata.xml from/to my-repo-id (https://artifactory.my-domain): Checksum validation failed: Checksum validation failed, expected 735e6640ca292ee83b39e7604446dbe03df20202 but is faf34f17acf90e006c7078f43af8e16c454bb08a
[WARNING] Encountered issue during deployment: Failed to retrieve remote metadata my.group.id:my-project/maven-metadata.xml: Could not transfer metadata my.group.id:my-project/maven-metadata.xml from/to my-repo-id (https://artifactory.my-domain): Checksum validation failed: Checksum validation failed, expected 735e6640ca292ee83b39e7604446dbe03df20202 but is faf34f17acf90e006c7078f43af8e16c454bb08a
[INFO] Retrying deployment attempt 3 of 10
[INFO] Uploading to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.zip
[INFO] Uploaded to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.zip (590 kB at 4.7 MB/s)
[INFO] Uploading to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.pom
[INFO] Uploaded to : https://artifactory.my-domain/my-path/my-project/0.0.42/my-project-0.0.42.pom (455 B at 4.9 kB/s)
[INFO] Downloading from : https://artifactory.my-domain/my-path/my-project/maven-metadata.xml
[INFO] Downloaded from : https://artifactory.my-domain/my-path/my-project/maven-metadata.xml (22 kB at 1.5 MB/s)
[INFO] Uploading to : https://artifactory.my-domain/my-path/my-project/maven-metadata.xml
[INFO] Uploaded to : https://artifactory.my-domain/my-path/my-project/maven-metadata.xml (22 kB at 260 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
...
Without retries, the build fails and the stack trace shows the ChecksumFailureException
is raised at
Br,
Régis
The OkHttpsWagon class has both EPL and Apache v2.0 license text in the header. I assume the Apache license is from the original code (LightweightHttpsWagon). Is it really ok to relicense this under EPL then?
See
Apparently the new multi thread put on io.takari.aether.connector.AetherRepositoryConnector is failing to handle 401 status on multiple tasks.
I'm working on m2e-core in a proxied environment. Some of the tests fail when a proxy is set in maven settings, but pass when no proxy is set. Of course, removing the proxy causes other tests to fail.
After debugging this, I found that the failing tests are failing because they are attempting to use proxy to reach localhost/127.0.0.1. I have nonProxyHosts set in my maven settings, but upon further debugging I noticed that nonProxyHosts is ignored in OkHttpWagon.openConnectionInternal because AetherClientProxy does not have any property for nonProxyHosts.
This seriously limits the usability of aether-connector-okhttp in proxied environments.
It will be nice to have a configuration to use preemtive authentication like in
Not only against proxies, but also against servers
Use case: Some Artifactory configurations force to use preemptive authentication.
In order to mitigate this, upgrade okhttp dependency to latest release (3.14.1).
I intend to open a PR for this.
I'll build and run the tests to validate that the upgrade did not break anything.
Anything else needed for the PR to be accepted?
Take a look at class AetherRepositoryConnector
. For each artifact, there's a corresponding GetTask
. And since there's a CountDownLatch
, I believe the tasks are designed to run in parallel.
But, the code calls Runnable.run()
directly, making it mono-threaded, see below:
The issue has been introduced with 32ce3f8
It can be reproduced by importing spring-petclinic into an empty maven workspace.
See eclipse-jdtls/eclipse.jdt.ls#1369 and https://ci.eclipse.org/ls/job/jdt-ls-pr/1903/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.