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

[MNG-8107] Update Resolver 2.0.0-alpha-11 #1488

Merged
merged 2 commits into from
Apr 26, 2024
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 @@ -111,6 +111,7 @@
import org.eclipse.aether.named.providers.LocalSemaphoreNamedLockFactory;
import org.eclipse.aether.named.providers.NoopNamedLockFactory;
import org.eclipse.aether.spi.artifact.ArtifactPredicateFactory;
import org.eclipse.aether.spi.artifact.decorator.ArtifactDecoratorFactory;
import org.eclipse.aether.spi.artifact.generator.ArtifactGeneratorFactory;
import org.eclipse.aether.spi.checksums.ProvidedChecksumsSource;
import org.eclipse.aether.spi.checksums.TrustedChecksumsSource;
Expand Down Expand Up @@ -155,8 +156,6 @@
* Important: Given the instance of supplier memorizes the supplier {@link RepositorySystem} instance it supplies,
* their lifecycle is shared as well: once supplied repository system is shut-down, this instance becomes closed as
* well. Any subsequent {@code getXXX} method invocation attempt will fail with {@link IllegalStateException}.
*
* @since 1.9.15
*/
public class RepositorySystemSupplier implements Supplier<RepositorySystem> {
private final AtomicBoolean closed = new AtomicBoolean(false);
Expand Down Expand Up @@ -640,7 +639,9 @@ public final Map<String, TransporterFactory> getTransporterFactories() {
protected Map<String, TransporterFactory> createTransporterFactories() {
HashMap<String, TransporterFactory> result = new HashMap<>();
result.put(FileTransporterFactory.NAME, new FileTransporterFactory());
result.put(ApacheTransporterFactory.NAME, new ApacheTransporterFactory(getChecksumExtractor()));
result.put(
ApacheTransporterFactory.NAME,
new ApacheTransporterFactory(getChecksumExtractor(), getPathProcessor()));
return result;
}

Expand Down Expand Up @@ -767,10 +768,18 @@ protected Map<String, DependencyCollectorDelegate> createDependencyCollectorDele
HashMap<String, DependencyCollectorDelegate> result = new HashMap<>();
result.put(
DfDependencyCollector.NAME,
new DfDependencyCollector(remoteRepositoryManager, artifactDescriptorReader, versionRangeResolver));
new DfDependencyCollector(
remoteRepositoryManager,
artifactDescriptorReader,
versionRangeResolver,
getArtifactDecoratorFactories()));
result.put(
BfDependencyCollector.NAME,
new BfDependencyCollector(remoteRepositoryManager, artifactDescriptorReader, versionRangeResolver));
new BfDependencyCollector(
remoteRepositoryManager,
artifactDescriptorReader,
versionRangeResolver,
getArtifactDecoratorFactories()));
return result;
}

Expand Down Expand Up @@ -882,6 +891,21 @@ protected Map<String, ArtifactGeneratorFactory> createArtifactGeneratorFactories
return new HashMap<>();
}

private Map<String, ArtifactDecoratorFactory> artifactDecoratorFactories;

public final Map<String, ArtifactDecoratorFactory> getArtifactDecoratorFactories() {
checkClosed();
if (artifactDecoratorFactories == null) {
artifactDecoratorFactories = createArtifactDecoratorFactories();
}
return artifactDecoratorFactories;
}

protected Map<String, ArtifactDecoratorFactory> createArtifactDecoratorFactories() {
// by default none, this is extension point
return new HashMap<>();
}

// Maven provided

private Map<String, MetadataGeneratorFactory> metadataGeneratorFactories;
Expand Down Expand Up @@ -1036,7 +1060,8 @@ protected RepositorySystem createRepositorySystem() {
getLocalRepositoryProvider(),
getSyncContextFactory(),
getRemoteRepositoryManager(),
getRepositorySystemLifecycle());
getRepositorySystemLifecycle(),
getArtifactDecoratorFactories());
}

@Override
Expand Down
Loading