Skip to content

Commit

Permalink
Revert "[MRESOLVER-446] Introduce version scheme selector (#384)"
Browse files Browse the repository at this point in the history
This reverts commit ddf5534.
  • Loading branch information
cstamas committed Dec 16, 2023
1 parent 3917705 commit 1bde99d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 208 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@
import org.eclipse.aether.internal.impl.synccontext.named.NameMappers;
import org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactory;
import org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactoryImpl;
import org.eclipse.aether.internal.impl.version.DefaultVersionSchemeSelector;
import org.eclipse.aether.internal.impl.version.GenericVersionSchemeProvider;
import org.eclipse.aether.named.NamedLockFactory;
import org.eclipse.aether.named.providers.FileLockNamedLockFactory;
import org.eclipse.aether.named.providers.LocalReadWriteLockNamedLockFactory;
Expand All @@ -122,7 +120,6 @@
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.spi.version.VersionSchemeSelector;
import org.eclipse.aether.transport.apache.ApacheTransporterFactory;
import org.eclipse.aether.transport.file.FileTransporterFactory;
import org.eclipse.aether.util.version.GenericVersionScheme;
Expand Down Expand Up @@ -441,14 +438,8 @@ protected MetadataResolver getMetadataResolver(
remoteRepositoryFilterManager);
}

protected Map<String, VersionScheme> getVersionSchemes() {
HashMap<String, VersionScheme> result = new HashMap<>();
result.put(GenericVersionSchemeProvider.NAME, new GenericVersionScheme());
return result;
}

protected VersionSchemeSelector getVersionSchemeSelector(Map<String, VersionScheme> versionSchemes) {
return new DefaultVersionSchemeSelector(versionSchemes);
protected VersionScheme getVersionScheme() {
return new GenericVersionScheme();
}

// Maven provided
Expand Down Expand Up @@ -493,14 +484,10 @@ protected VersionRangeResolver getVersionRangeResolver(
MetadataResolver metadataResolver,
SyncContextFactory syncContextFactory,
RepositoryEventDispatcher repositoryEventDispatcher,
VersionSchemeSelector versionSchemeSelector) {
VersionScheme versionScheme) {
// from maven-resolver-provider
// TODO: hack here, until maven bits does not pick this change
return new DefaultVersionRangeResolver(
metadataResolver,
syncContextFactory,
repositoryEventDispatcher,
versionSchemeSelector.selectVersionScheme(GenericVersionSchemeProvider.NAME));
metadataResolver, syncContextFactory, repositoryEventDispatcher, versionScheme);
}

protected ModelBuilder getModelBuilder() {
Expand Down Expand Up @@ -594,12 +581,11 @@ public RepositorySystem get() {
offlineController,
remoteRepositoryFilterManager);

Map<String, VersionScheme> versionSchemes = getVersionSchemes();
VersionSchemeSelector versionSchemeSelector = getVersionSchemeSelector(versionSchemes);
VersionScheme versionScheme = getVersionScheme();
VersionResolver versionResolver =
getVersionResolver(metadataResolver, syncContextFactory, repositoryEventDispatcher);
VersionRangeResolver versionRangeResolver = getVersionRangeResolver(
metadataResolver, syncContextFactory, repositoryEventDispatcher, versionSchemeSelector);
VersionRangeResolver versionRangeResolver =
getVersionRangeResolver(metadataResolver, syncContextFactory, repositoryEventDispatcher, versionScheme);

Map<String, ArtifactResolverPostProcessor> artifactResolverPostProcessors =
getArtifactResolverPostProcessors(checksumAlgorithmFactorySelector, trustedChecksumsSources);
Expand Down
1 change: 0 additions & 1 deletion src/site/markdown/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ under the License.
| 96. | `"aether.trustedChecksumsSource.summaryFile.basedir"` | `java.lang.String` | The basedir where checksums are. If relative, is resolved from local repository root. | `".checksums"` | 1.9.0 | No | Session Configuration |
| 97. | `"aether.trustedChecksumsSource.summaryFile.originAware"` | `java.lang.Boolean` | Is source origin aware? | `true` | 1.9.0 | No | Session Configuration |
| 98. | `"aether.updateCheckManager.sessionState"` | `java.lang.String` | Manages the session state, i.e. influences if the same download requests to artifacts/metadata will happen multiple times within the same RepositorySystemSession. If "enabled" will enable the session state. If "bypass" will enable bypassing (i.e. store all artifact ids/metadata ids which have been updates but not evaluating those). All other values lead to disabling the session state completely. | `"enabled"` | | No | Session Configuration |
| 99. | `"aether.versionScheme.name"` | `java.lang.String` | The name of the version scheme to be used in session. | `"generic"` | 2.0.0 | No | Session Configuration |


All properties which have `yes` in the column `Supports Repo ID Suffix` can be optionally configured specifically for a repository id. In that case the configuration property needs to be suffixed with a period followed by the repository id of the repository to configure, e.g. `aether.connector.http.headers.central` for repository with id `central`.
Expand Down

0 comments on commit 1bde99d

Please sign in to comment.