MPLUGINTESTING-44 maven 3.2.4 compatibility Signed-off-by: Igor Fedorenko <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/commit/81f2998f Tree: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/tree/81f2998f Diff: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/diff/81f2998f Branch: refs/heads/master Commit: 81f2998fa34c54976a5396f39e635e1de9583801 Parents: 08cbd18 Author: Igor Fedorenko <[email protected]> Authored: Mon Nov 17 09:55:27 2014 -0500 Committer: Igor Fedorenko <[email protected]> Committed: Mon Nov 17 10:51:14 2014 -0500 ---------------------------------------------------------------------- .../maven/plugin/testing/AbstractMojoTestCase.java | 16 ---------------- .../org/apache/maven/plugin/testing/MojoRule.java | 2 +- .../maven/plugin/testing/ParametersMojoTest.java | 4 ++-- pom.xml | 2 +- 4 files changed, 4 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/81f2998f/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java ---------------------------------------------------------------------- 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 91edd5e..9b49e71 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 @@ -42,8 +42,6 @@ import org.apache.maven.execution.DefaultMavenExecutionResult; import org.apache.maven.execution.MavenExecutionRequest; import org.apache.maven.execution.MavenExecutionResult; import org.apache.maven.execution.MavenSession; -import org.apache.maven.execution.scope.MojoExecutionScoped; -import org.apache.maven.execution.scope.internal.MojoExecutionScope; import org.apache.maven.lifecycle.internal.MojoDescriptorCreator; import org.apache.maven.model.Plugin; import org.apache.maven.monitor.logging.DefaultLog; @@ -80,7 +78,6 @@ import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.codehaus.plexus.util.xml.Xpp3DomBuilder; -import com.google.inject.AbstractModule; import com.google.inject.Module; /** @@ -226,19 +223,6 @@ public abstract class AbstractMojoTestCase try { List<Module> modules = new ArrayList<Module>(); - modules.add( new AbstractModule() - { - @Override - protected void configure() - { - // execution scope bindings (core binds these in plugin realm injector only) - MojoExecutionScope executionScope = new MojoExecutionScope(); - bindScope( MojoExecutionScoped.class, executionScope ); - bind( MojoExecutionScope.class ).toInstance( executionScope ); - bind( MavenProject.class ).toProvider( MojoExecutionScope.<MavenProject> seededKeyProvider() ).in( executionScope ); - bind( MojoExecution.class ).toProvider( MojoExecutionScope.<MojoExecution> seededKeyProvider() ).in( executionScope ); - } - } ); addGuiceModules( modules ); container = new DefaultPlexusContainer( cc, modules.toArray( new Module[modules.size()] ) ); } http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/81f2998f/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java ---------------------------------------------------------------------- diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java index d4d57f0..0f8e91e 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java @@ -23,7 +23,6 @@ import java.io.File; import java.io.InputStream; import java.util.Map; -import org.apache.maven.SessionScope; import org.apache.maven.execution.DefaultMavenExecutionRequest; import org.apache.maven.execution.MavenExecutionRequest; import org.apache.maven.execution.MavenSession; @@ -35,6 +34,7 @@ import org.apache.maven.plugin.MojoExecution; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.session.scope.internal.SessionScope; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.configurator.ComponentConfigurationException; http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/81f2998f/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java ---------------------------------------------------------------------- diff --git a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java index 3f36d8a..c009a5b 100644 --- a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java +++ b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java @@ -25,12 +25,11 @@ import org.apache.maven.execution.DefaultMavenExecutionRequest; import org.apache.maven.execution.MavenExecutionRequest; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.MojoExecution; -import org.apache.maven.plugin.testing.AbstractMojoTestCase; -import org.apache.maven.plugin.testing.ParametersMojo; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingException; import org.apache.maven.project.ProjectBuildingRequest; +import org.eclipse.aether.DefaultRepositorySystemSession; public class ParametersMojoTest extends AbstractMojoTestCase @@ -100,6 +99,7 @@ public class ParametersMojoTest MavenExecutionRequest request = new DefaultMavenExecutionRequest(); request.setBaseDirectory( basedir ); ProjectBuildingRequest configuration = request.getProjectBuildingRequest(); + configuration.setRepositorySession( new DefaultRepositorySystemSession() ); MavenProject project = lookup( ProjectBuilder.class ).build( pom, configuration ).getProject(); assertNotNull( project ); return project; http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/81f2998f/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index ed53b95..2a0172a 100644 --- a/pom.xml +++ b/pom.xml @@ -145,7 +145,7 @@ under the License. </distributionManagement> <properties> - <mavenVersion>3.2.1</mavenVersion> + <mavenVersion>3.2.4-SNAPSHOT</mavenVersion> <plexusVersion>1.5.5</plexusVersion> <maven.site.path>plugin-testing-archives/LATEST</maven.site.path> <!-- Not sure if this is intentional but MojoRule has an @Override annotation from the interface which is
