Skip to content

Commit

Permalink
[MNG-8107] Update Resolver 2.0.0-alpha-11 (#1488)
Browse files Browse the repository at this point in the history
Update to Resolver 2.0.0-alpha-11 and restore renamed class.

---

https://issues.apache.org/jira/browse/MNG-8107
  • Loading branch information
cstamas authored Apr 26, 2024
1 parent 6fddd97 commit 8fbbbc9
Show file tree
Hide file tree
Showing 3 changed files with 1,146 additions and 7 deletions.
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

0 comments on commit 8fbbbc9

Please sign in to comment.