MPLUGINTESTING-44 maven 3.2.4 compatibility
authorIgor Fedorenko <ifedorenko@apache.org>
Mon, 17 Nov 2014 14:55:27 +0000 (09:55 -0500)
committerIgor Fedorenko <ifedorenko@apache.org>
Mon, 17 Nov 2014 15:51:14 +0000 (10:51 -0500)
Signed-off-by: Igor Fedorenko <ifedorenko@apache.org>
maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java
maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java
maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java
pom.xml

index 91edd5e..9b49e71 100644 (file)
@@ -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()] ) );
         }
index d4d57f0..0f8e91e 100644 (file)
@@ -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;
index 3f36d8a..c009a5b 100644 (file)
@@ -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;
diff --git a/pom.xml b/pom.xml
index ed53b95..2a0172a 100644 (file)
--- 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