Skip to content
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
2 changes: 1 addition & 1 deletion maven-plugin-testing-harness/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ under the License.
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-xml-impl</artifactId>
<artifactId>maven-xml</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
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.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;
Expand Down Expand Up @@ -140,6 +139,7 @@
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.artifact.transformer.ArtifactTransformer;
import org.eclipse.aether.spi.checksums.ProvidedChecksumsSource;
import org.eclipse.aether.spi.checksums.TrustedChecksumsSource;
import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
Expand Down Expand Up @@ -752,6 +752,7 @@ protected Installer createInstaller() {
getRepositoryEventDispatcher(),
getArtifactGeneratorFactories(),
getMetadataGeneratorFactories(),
getArtifactTransformers(),
getSyncContextFactory());
}

Expand All @@ -774,6 +775,7 @@ protected Deployer createDeployer() {
getUpdateCheckManager(),
getArtifactGeneratorFactories(),
getMetadataGeneratorFactories(),
getArtifactTransformers(),
getSyncContextFactory(),
getOfflineController());
}
Expand Down Expand Up @@ -933,6 +935,20 @@ protected Map<String, ArtifactDecoratorFactory> createArtifactDecoratorFactories
return new HashMap<>();
}

protected Map<String, ArtifactTransformer> artifactTransformers;

public final Map<String, ArtifactTransformer> getArtifactTransformers() {
checkClosed();
if (artifactTransformers == null) {
artifactTransformers = createArtifactTransformers();
}
return artifactTransformers;
}

protected Map<String, ArtifactTransformer> createArtifactTransformers() {
return new HashMap<>();
}

// Maven provided

private Map<String, MetadataGeneratorFactory> metadataGeneratorFactories;
Expand Down Expand Up @@ -1058,13 +1074,13 @@ protected ModelBuilder createModelBuilder() {
new DefaultDependencyManagementInjector(),
new DefaultDependencyManagementImporter(),
new DefaultPluginConfigurationExpander(),
new ProfileActivationFilePathInterpolator(
new DefaultPathTranslator(), new DefaultRootLocator(), new DefaultInterpolator()),
new DefaultModelVersionParser(getVersionScheme()),
List.of(),
new DefaultModelCacheFactory(),
new DefaultModelResolver(),
new DefaultInterpolator());
new DefaultInterpolator(),
new DefaultPathTranslator(),
new DefaultRootLocator());
}

private RepositorySystem repositorySystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ public static InternalSession getMockSession(LocalRepository localRepository) {
.installArtifacts(any(Collection.class));
doAnswer(iom -> {
artifactInstaller.install(ArtifactInstallerRequest.build(
session, Arrays.asList(iom.getArgument(0, Artifact[].class))));
session, Arrays.asList(iom.getArgument(0, ProducedArtifact[].class))));
return null;
})
.when(session)
.installArtifacts(any(Artifact[].class));
.installArtifacts(any(ProducedArtifact[].class));
doAnswer(iom -> {
artifactInstaller.install(ArtifactInstallerRequest.build(
iom.getArgument(0, Session.class), iom.getArgument(1, Collection.class)));
return null;
})
.when(artifactInstaller)
.install(any(Session.class), ArgumentMatchers.<Collection<Artifact>>any());
.install(any(Session.class), ArgumentMatchers.<Collection<ProducedArtifact>>any());
when(session.getService(ArtifactInstaller.class)).thenReturn(artifactInstaller);

//
Expand All @@ -180,7 +180,7 @@ public static InternalSession getMockSession(LocalRepository localRepository) {
artifactDeployer.deploy(ArtifactDeployerRequest.build(
iom.getArgument(0, Session.class),
iom.getArgument(1, RemoteRepository.class),
Arrays.asList(iom.getArgument(2, Artifact[].class))));
Arrays.asList(iom.getArgument(2, ProducedArtifact[].class))));
return null;
})
.when(session)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,13 @@ public List<Version> resolveVersionRange(ArtifactCoordinates artifact, List<Remo
}

@Override
public void installArtifacts(Artifact... artifacts) {}
public void installArtifacts(ProducedArtifact... artifacts) {}

@Override
public void installArtifacts(Collection<Artifact> artifacts) {}
public void installArtifacts(Collection<ProducedArtifact> artifacts) {}

@Override
public void deployArtifact(RemoteRepository repository, Artifact... artifacts) {}
public void deployArtifact(RemoteRepository repository, ProducedArtifact... artifacts) {}

@Override
public void setArtifactPath(ProducedArtifact artifact, Path path) {}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ under the License.

<properties>
<surefire.version>3.5.1</surefire.version>
<mavenVersion>4.0.0-beta-5</mavenVersion>
<mavenVersion>4.0.0-rc-2</mavenVersion>
<maven.site.path>plugin-testing-archives/LATEST</maven.site.path>
<javaVersion>17</javaVersion>
<project.build.outputTimestamp>2024-11-08T07:31:16Z</project.build.outputTimestamp>
Expand Down
Loading