diff --git a/maven-plugin-testing-harness/pom.xml b/maven-plugin-testing-harness/pom.xml index b6a5a4b..3d7419b 100644 --- a/maven-plugin-testing-harness/pom.xml +++ b/maven-plugin-testing-harness/pom.xml @@ -44,12 +44,6 @@ under the License. ${mavenVersion} provided - - org.apache.maven - maven-compat - ${mavenVersion} - provided - org.apache.maven maven-model diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java index a163e5d..c2b2309 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java @@ -37,6 +37,8 @@ import com.google.inject.Module; import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.handler.DefaultArtifactHandler; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.execution.DefaultMavenExecutionRequest; import org.apache.maven.execution.DefaultMavenExecutionResult; @@ -53,7 +55,6 @@ import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder; import org.apache.maven.project.MavenProject; -import org.apache.maven.repository.RepositorySystem; import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.DefaultContainerConfiguration; @@ -140,12 +141,14 @@ protected void setUp() throws Exception { PluginDescriptor pluginDescriptor = new PluginDescriptorBuilder().build(interpolationReader); - Artifact artifact = lookup(RepositorySystem.class) - .createArtifact( - pluginDescriptor.getGroupId(), - pluginDescriptor.getArtifactId(), - pluginDescriptor.getVersion(), - ".jar"); + Artifact artifact = new DefaultArtifact( + pluginDescriptor.getGroupId(), + pluginDescriptor.getArtifactId(), + pluginDescriptor.getVersion(), + null, + "jar", + null, + new DefaultArtifactHandler("jar")); artifact.setFile(getPluginArtifactFile()); pluginDescriptor.setPluginArtifact(artifact);