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

[MRESOLVER-440] Addendum #382

Merged
merged 1 commit into from
Nov 28, 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
2 changes: 1 addition & 1 deletion maven-resolver-demos/maven-resolver-demo-snippets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<artifactId>maven-resolver-transport-apache</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.spi.connector.transport.TransporterFactory;
import org.eclipse.aether.supplier.RepositorySystemSupplier;
import org.eclipse.aether.transport.http.ChecksumExtractor;
import org.eclipse.aether.transport.jdk.JdkTransporterFactory;
import org.eclipse.aether.transport.jetty.JettyTransporterFactory;

Expand All @@ -34,9 +33,8 @@ public class SupplierRepositorySystemFactory {
public static RepositorySystem newRepositorySystem() {
return new RepositorySystemSupplier() {
@Override
protected Map<String, TransporterFactory> getTransporterFactories(
Map<String, ChecksumExtractor> extractors) {
Map<String, TransporterFactory> result = super.getTransporterFactories(extractors);
protected Map<String, TransporterFactory> getTransporterFactories() {
Map<String, TransporterFactory> result = super.getTransporterFactories();
result.put(JdkTransporterFactory.NAME, new JdkTransporterFactory());
result.put(JettyTransporterFactory.NAME, new JettyTransporterFactory());
return result;
Expand Down
2 changes: 1 addition & 1 deletion maven-resolver-supplier/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<artifactId>maven-resolver-transport-apache</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,8 @@
import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory;
import org.eclipse.aether.spi.resolution.ArtifactResolverPostProcessor;
import org.eclipse.aether.spi.synccontext.SyncContextFactory;
import org.eclipse.aether.transport.apache.ApacheTransporterFactory;
import org.eclipse.aether.transport.file.FileTransporterFactory;
import org.eclipse.aether.transport.http.ChecksumExtractor;
import org.eclipse.aether.transport.http.HttpTransporterFactory;
import org.eclipse.aether.transport.http.Nexus2ChecksumExtractor;
import org.eclipse.aether.transport.http.XChecksumChecksumExtractor;
import org.eclipse.aether.util.version.GenericVersionScheme;
import org.eclipse.aether.version.VersionScheme;

Expand Down Expand Up @@ -300,17 +297,10 @@ protected Map<String, ProvidedChecksumsSource> getProvidedChecksumsSources(
return result;
}

protected Map<String, ChecksumExtractor> getChecksumExtractors() {
HashMap<String, ChecksumExtractor> result = new HashMap<>();
result.put(Nexus2ChecksumExtractor.NAME, new Nexus2ChecksumExtractor());
result.put(XChecksumChecksumExtractor.NAME, new XChecksumChecksumExtractor());
return result;
}

protected Map<String, TransporterFactory> getTransporterFactories(Map<String, ChecksumExtractor> extractors) {
protected Map<String, TransporterFactory> getTransporterFactories() {
HashMap<String, TransporterFactory> result = new HashMap<>();
result.put(FileTransporterFactory.NAME, new FileTransporterFactory());
result.put(HttpTransporterFactory.NAME, new HttpTransporterFactory(extractors));
result.put(ApacheTransporterFactory.NAME, new ApacheTransporterFactory());
return result;
}

Expand Down Expand Up @@ -555,8 +545,7 @@ public RepositorySystem get() {
Map<String, ProvidedChecksumsSource> providedChecksumsSources =
getProvidedChecksumsSources(trustedChecksumsSources);

Map<String, ChecksumExtractor> checksumExtractors = getChecksumExtractors();
Map<String, TransporterFactory> transporterFactories = getTransporterFactories(checksumExtractors);
Map<String, TransporterFactory> transporterFactories = getTransporterFactories();
TransporterProvider transporterProvider = getTransporterProvider(transporterFactories);

BasicRepositoryConnectorFactory basic = getBasicRepositoryConnectorFactory(
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<artifactId>maven-resolver-transport-apache</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down