Skip to content

Commit

Permalink
Maven 4.0.0-beta-3 updates
Browse files Browse the repository at this point in the history
Changes:
* remove SystemScopeHandler (was added in alpha-8 and implemented in Maven 4 alpha-13)
* scope configuration canonical source is Maven4, use it
* RepositorySystem and SessionBuilder supplier canonical source is Maven4
  • Loading branch information
cstamas committed May 23, 2024
1 parent 0320c86 commit 1cd114e
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 229 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@

import org.apache.maven.model.building.DefaultModelBuilderFactory;
import org.apache.maven.model.building.ModelBuilder;
import org.apache.maven.repository.internal.*;
import org.apache.maven.repository.internal.DefaultArtifactDescriptorReader;
import org.apache.maven.repository.internal.DefaultModelCacheFactory;
import org.apache.maven.repository.internal.DefaultVersionRangeResolver;
import org.apache.maven.repository.internal.DefaultVersionResolver;
import org.apache.maven.repository.internal.MavenArtifactRelocationSource;
import org.apache.maven.repository.internal.ModelCacheFactory;
import org.apache.maven.repository.internal.PluginsMetadataGeneratorFactory;
import org.apache.maven.repository.internal.SnapshotMetadataGeneratorFactory;
import org.apache.maven.repository.internal.VersionsMetadataGeneratorFactory;
import org.apache.maven.repository.internal.relocation.DistributionManagementArtifactRelocationSource;
import org.apache.maven.repository.internal.relocation.UserPropertiesArtifactRelocationSource;
import org.eclipse.aether.RepositoryListener;
Expand All @@ -50,7 +58,34 @@
import org.eclipse.aether.impl.UpdatePolicyAnalyzer;
import org.eclipse.aether.impl.VersionRangeResolver;
import org.eclipse.aether.impl.VersionResolver;
import org.eclipse.aether.internal.impl.*;
import org.eclipse.aether.internal.impl.DefaultArtifactPredicateFactory;
import org.eclipse.aether.internal.impl.DefaultArtifactResolver;
import org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider;
import org.eclipse.aether.internal.impl.DefaultChecksumProcessor;
import org.eclipse.aether.internal.impl.DefaultDeployer;
import org.eclipse.aether.internal.impl.DefaultInstaller;
import org.eclipse.aether.internal.impl.DefaultLocalPathComposer;
import org.eclipse.aether.internal.impl.DefaultLocalPathPrefixComposerFactory;
import org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider;
import org.eclipse.aether.internal.impl.DefaultMetadataResolver;
import org.eclipse.aether.internal.impl.DefaultOfflineController;
import org.eclipse.aether.internal.impl.DefaultPathProcessor;
import org.eclipse.aether.internal.impl.DefaultRemoteRepositoryManager;
import org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider;
import org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher;
import org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider;
import org.eclipse.aether.internal.impl.DefaultRepositorySystem;
import org.eclipse.aether.internal.impl.DefaultRepositorySystemLifecycle;
import org.eclipse.aether.internal.impl.DefaultTrackingFileManager;
import org.eclipse.aether.internal.impl.DefaultTransporterProvider;
import org.eclipse.aether.internal.impl.DefaultUpdateCheckManager;
import org.eclipse.aether.internal.impl.DefaultUpdatePolicyAnalyzer;
import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory;
import org.eclipse.aether.internal.impl.LocalPathComposer;
import org.eclipse.aether.internal.impl.LocalPathPrefixComposerFactory;
import org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory;
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
import org.eclipse.aether.internal.impl.TrackingFileManager;
import org.eclipse.aether.internal.impl.checksum.DefaultChecksumAlgorithmFactorySelector;
import org.eclipse.aether.internal.impl.checksum.Md5ChecksumAlgorithmFactory;
import org.eclipse.aether.internal.impl.checksum.Sha1ChecksumAlgorithmFactory;
Expand Down Expand Up @@ -107,7 +142,7 @@
import org.eclipse.aether.version.VersionScheme;

/**
* A simple memorizing {@link Supplier} of {@link org.eclipse.aether.RepositorySystem} instance, that on first call
* A simple memorizing {@link Supplier} of {@link RepositorySystem} instance, that on first call
* supplies lazily constructed instance, and on each subsequent call same instance. Hence, this instance should be
* thrown away immediately once repository system was created and there is no need for more instances. If new
* repository system instance needed, new instance of this class must be created. For proper shut down of returned
Expand All @@ -127,7 +162,7 @@
* 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
* @since 2.0.0
*/
public class RepositorySystemSupplier implements Supplier<RepositorySystem> {
private final AtomicBoolean closed = new AtomicBoolean(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession.CloseableSession;
import org.eclipse.aether.RepositorySystemSession.SessionBuilder;
import org.eclipse.aether.collection.DependencyManager;
import org.eclipse.aether.impl.scope.InternalScopeManager;
import org.eclipse.aether.internal.impl.scope.ScopeManagerImpl;
import org.eclipse.aether.util.graph.manager.ClassicDependencyManager;

/**
* A simple {@link Supplier} of {@link SessionBuilder} instances, that on each call supplies newly
Expand All @@ -42,19 +38,4 @@ public class SessionBuilderSupplier extends MavenSessionBuilderSupplier {
public SessionBuilderSupplier(RepositorySystem repositorySystem) {
super(repositorySystem);
}

@Override
protected void configureSessionBuilder(SessionBuilder session) {
super.configureSessionBuilder(session);
session.setScopeManager(getScopeManager());
}

@Override
protected DependencyManager getDependencyManager() {
return new ClassicDependencyManager(true, getScopeManager()); // same default as in Maven4
}

protected InternalScopeManager getScopeManager() {
return new ScopeManagerImpl(Maven4ScopeManagerConfiguration.INSTANCE);
}
}
17 changes: 16 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<jettyVersion>10.0.21</jettyVersion>
<!-- used by supplier and demo only -->
<maven3Version>3.9.6</maven3Version>
<maven4Version>4.0.0-alpha-13</maven4Version>
<maven4Version>4.0.0-beta-3</maven4Version>
<minimalMavenBuildVersion>[3.8.8,)</minimalMavenBuildVersion>
<!-- MRESOLVER-422: keep this in sync with Javadoc plugin configuration (but cannot directly, as this below is range) -->
<minimalJavaBuildVersion>[21,)</minimalJavaBuildVersion>
Expand Down Expand Up @@ -280,6 +280,21 @@
</dependencies>
</dependencyManagement>

<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>maven-2126</id>
<url>https://repository.apache.org/content/repositories/maven-2126/</url>
</repository>
</repositories>

<build>
<pluginManagement>
<plugins>
Expand Down

0 comments on commit 1cd114e

Please sign in to comment.