diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/ArtifactStub.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/ArtifactStub.java index aa0c958..df9e5c2 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/ArtifactStub.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/ArtifactStub.java @@ -25,8 +25,8 @@ import org.apache.maven.api.Version; import org.apache.maven.api.VersionConstraint; import org.apache.maven.api.annotations.Nonnull; +import org.apache.maven.internal.impl.DefaultModelVersionParser; import org.apache.maven.internal.impl.DefaultVersionParser; -import org.apache.maven.repository.internal.DefaultModelVersionParser; import org.eclipse.aether.util.version.GenericVersionScheme; /** diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/RepositorySystemSupplier.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/RepositorySystemSupplier.java index 0e709b3..e27e108 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/RepositorySystemSupplier.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/RepositorySystemSupplier.java @@ -32,24 +32,25 @@ import org.apache.maven.internal.impl.DefaultPluginConfigurationExpander; import org.apache.maven.internal.impl.DefaultSuperPomProvider; import org.apache.maven.internal.impl.DefaultUrlNormalizer; -import org.apache.maven.internal.impl.model.BuildModelTransformer; import org.apache.maven.internal.impl.model.DefaultDependencyManagementImporter; import org.apache.maven.internal.impl.model.DefaultDependencyManagementInjector; import org.apache.maven.internal.impl.model.DefaultInheritanceAssembler; +import org.apache.maven.internal.impl.model.DefaultInterpolator; import org.apache.maven.internal.impl.model.DefaultModelBuilder; +import org.apache.maven.internal.impl.model.DefaultModelCacheFactory; import org.apache.maven.internal.impl.model.DefaultModelInterpolator; import org.apache.maven.internal.impl.model.DefaultModelNormalizer; import org.apache.maven.internal.impl.model.DefaultModelPathTranslator; import org.apache.maven.internal.impl.model.DefaultModelProcessor; import org.apache.maven.internal.impl.model.DefaultModelValidator; -import org.apache.maven.internal.impl.model.DefaultModelVersionProcessor; import org.apache.maven.internal.impl.model.DefaultPathTranslator; import org.apache.maven.internal.impl.model.DefaultPluginManagementInjector; import org.apache.maven.internal.impl.model.DefaultProfileInjector; import org.apache.maven.internal.impl.model.DefaultProfileSelector; -import org.apache.maven.internal.impl.model.DefaultRootLocator; import org.apache.maven.internal.impl.model.ProfileActivationFilePathInterpolator; +import org.apache.maven.internal.impl.model.rootlocator.DefaultRootLocator; import org.apache.maven.internal.impl.resolver.DefaultArtifactDescriptorReader; +import org.apache.maven.internal.impl.resolver.DefaultModelResolver; import org.apache.maven.internal.impl.resolver.DefaultVersionRangeResolver; import org.apache.maven.internal.impl.resolver.DefaultVersionResolver; import org.apache.maven.internal.impl.resolver.MavenArtifactRelocationSource; @@ -79,7 +80,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; @@ -959,9 +987,7 @@ public final ArtifactDescriptorReader getArtifactDescriptorReader() { protected ArtifactDescriptorReader createArtifactDescriptorReader() { // from maven-resolver-provider return new DefaultArtifactDescriptorReader( - getRemoteRepositoryManager(), getVersionResolver(), - getVersionRangeResolver(), getArtifactResolver(), getModelBuilder(), getRepositoryEventDispatcher(), @@ -1015,10 +1041,13 @@ protected ModelBuilder createModelBuilder() { DefaultModelProcessor modelProcessor = new DefaultModelProcessor(new DefaultModelXmlFactory(), List.of()); return new DefaultModelBuilder( modelProcessor, - new DefaultModelValidator(new DefaultModelVersionProcessor()), + new DefaultModelValidator(), new DefaultModelNormalizer(), new DefaultModelInterpolator( - new DefaultPathTranslator(), new DefaultUrlNormalizer(), new DefaultRootLocator()), + new DefaultPathTranslator(), + new DefaultUrlNormalizer(), + new DefaultRootLocator(), + new DefaultInterpolator()), new DefaultModelPathTranslator(new DefaultPathTranslator()), new DefaultModelUrlNormalizer(new DefaultUrlNormalizer()), new DefaultSuperPomProvider(modelProcessor), @@ -1028,11 +1057,14 @@ protected ModelBuilder createModelBuilder() { new DefaultPluginManagementInjector(), new DefaultDependencyManagementInjector(), new DefaultDependencyManagementImporter(), - (m, r, b) -> m, new DefaultPluginConfigurationExpander(), - new ProfileActivationFilePathInterpolator(new DefaultPathTranslator(), new DefaultRootLocator()), - new BuildModelTransformer(), - new DefaultModelVersionParser(getVersionScheme())); + new ProfileActivationFilePathInterpolator( + new DefaultPathTranslator(), new DefaultRootLocator(), new DefaultInterpolator()), + new DefaultModelVersionParser(getVersionScheme()), + List.of(), + new DefaultModelCacheFactory(), + new DefaultModelResolver(), + new DefaultInterpolator()); } private RepositorySystem repositorySystem; diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/SessionMock.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/SessionMock.java index 7d8d180..81d6887 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/SessionMock.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/SessionMock.java @@ -56,11 +56,11 @@ import org.apache.maven.api.services.RepositoryFactory; import org.apache.maven.api.services.VersionParser; import org.apache.maven.api.services.xml.ModelXmlFactory; +import org.apache.maven.internal.impl.DefaultModelVersionParser; import org.apache.maven.internal.impl.DefaultModelXmlFactory; import org.apache.maven.internal.impl.DefaultVersionParser; import org.apache.maven.internal.impl.InternalSession; import org.apache.maven.model.v4.MavenStaxReader; -import org.apache.maven.repository.internal.DefaultModelVersionParser; import org.eclipse.aether.util.version.GenericVersionScheme; import org.mockito.ArgumentMatchers; diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/SessionStub.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/SessionStub.java index eab74fa..f9c2390 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/SessionStub.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/api/plugin/testing/stubs/SessionStub.java @@ -274,6 +274,16 @@ public DownloadedArtifact resolveArtifact(ArtifactCoordinates coordinate) { return null; } + @Override + public DownloadedArtifact resolveArtifact(ArtifactCoordinates coordinates, List repositories) { + return null; + } + + @Override + public DownloadedArtifact resolveArtifact(Artifact artifact, List repositories) { + return null; + } + @Override public Collection resolveArtifacts(ArtifactCoordinates... artifactCoordinates) { return null; @@ -289,6 +299,12 @@ public Collection resolveArtifacts(Artifact... artifacts) { return null; } + @Override + public Collection resolveArtifacts( + Collection coordinates, List repositories) { + return null; + } + @Override public List flattenDependencies(Node node, PathScope scope) { return null; @@ -319,6 +335,11 @@ public List resolveVersionRange(ArtifactCoordinates artifact) { return null; } + @Override + public List resolveVersionRange(ArtifactCoordinates artifact, List repositories) { + return null; + } + @Override public void installArtifacts(Artifact... artifacts) {} @@ -342,17 +363,17 @@ public boolean isVersionSnapshot(String version) { } @Override - public Node collectDependencies(Artifact artifact) { + public Node collectDependencies(Artifact artifact, PathScope scope) { return null; } @Override - public Node collectDependencies(Project project) { + public Node collectDependencies(Project project, PathScope scope) { return null; } @Override - public Node collectDependencies(DependencyCoordinates dependencyCoordinates) { + public Node collectDependencies(DependencyCoordinates dependencyCoordinates, PathScope scope) { return null; } diff --git a/pom.xml b/pom.xml index b54fb5e..20576b7 100644 --- a/pom.xml +++ b/pom.xml @@ -65,10 +65,12 @@ under the License. 3.2.1 - 4.0.0-beta-4-SNAPSHOT + 4.0.0-beta-5-SNAPSHOT plugin-testing-archives/LATEST 17 2024-06-26T07:42:15Z + 4.0.0-M16 + 2.0.0-M10