Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ protected void setUp(TestInfo testInfo) throws Exception {
factory = transporterFactorySupplier.get();
repoDir = TestFileUtils.createTempDir();
TestFileUtils.writeString(new File(repoDir, "file.txt"), "test");
TestFileUtils.writeString(new File(repoDir, "artifact.pom"), "<xml>pom</xml>");
TestFileUtils.writeString(new File(repoDir, "dir/file.txt"), "test");
TestFileUtils.writeString(new File(repoDir, "dir/oldFile.txt"), "oldTest", OLD_FILE_TIMESTAMP);
TestFileUtils.writeString(new File(repoDir, "empty.txt"), "");
Expand Down Expand Up @@ -391,6 +392,17 @@ protected void testGet_ToFileTimestamp() throws Exception {
assertEquals(OLD_FILE_TIMESTAMP, file.lastModified());
}

@Test
protected void testGet_CompressionUsedWithPom() throws Exception {
File file = TestFileUtils.createTempFile("pom");
GetTask task = new GetTask(URI.create("repo/artifact.pom")).setDataPath(file.toPath());
transporter.get(task);
String acceptEncoding = httpServer.getLogEntries().get(0).getHeaders().get("Accept-Encoding");
assertNotNull(acceptEncoding, "Missing Accept-Encoding header when retrieving pom");
// support either gzip or deflate as the transporter implementation may vary
assertTrue(acceptEncoding.contains("gzip") || acceptEncoding.contains("deflate"));
}

@Test
protected void testGet_EmptyResource() throws Exception {
File file = TestFileUtils.createTempFile("failure");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
</dependency>
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
<artifactId>methanol</artifactId>
<version>1.8.3</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import java.util.function.Supplier;
import java.util.regex.Matcher;

import com.github.mizosoft.methanol.Methanol;
import org.eclipse.aether.ConfigurationProperties;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.repository.AuthenticationContext;
Expand Down Expand Up @@ -485,7 +486,7 @@ public X509Certificate[] getAcceptedIssuers() {
}
}

HttpClient.Builder builder = HttpClient.newBuilder()
HttpClient.Builder builder = Methanol.newBuilder()
.version(HttpClient.Version.valueOf(ConfigUtils.getString(
session,
DEFAULT_HTTP_VERSION,
Expand Down