You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by if...@apache.org on 2014/11/17 16:51:25 UTC

[1/3] maven-plugin-testing git commit: MPLUGINTESTING-44 version 3.3.0 to signify maven 3.2.4+ requirement

Repository: maven-plugin-testing
Updated Branches:
  refs/heads/master 08cbd1847 -> 6bf55326a


MPLUGINTESTING-44 version 3.3.0 to signify maven 3.2.4+ requirement

Signed-off-by: Igor Fedorenko <if...@apache.org>


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/6bf55326
Tree: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/tree/6bf55326
Diff: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/diff/6bf55326

Branch: refs/heads/master
Commit: 6bf55326ace4a78c49be055a571a2b6b399e7407
Parents: 65c2885
Author: Igor Fedorenko <if...@apache.org>
Authored: Mon Nov 17 10:22:39 2014 -0500
Committer: Igor Fedorenko <if...@apache.org>
Committed: Mon Nov 17 10:51:14 2014 -0500

----------------------------------------------------------------------
 maven-plugin-testing-harness/pom.xml | 2 +-
 maven-plugin-testing-tools/pom.xml   | 2 +-
 maven-test-tools/pom.xml             | 2 +-
 pom.xml                              | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/6bf55326/maven-plugin-testing-harness/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugin-testing-harness/pom.xml b/maven-plugin-testing-harness/pom.xml
index 3acd286..a839c39 100644
--- a/maven-plugin-testing-harness/pom.xml
+++ b/maven-plugin-testing-harness/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven.plugin-testing</groupId>
     <artifactId>maven-plugin-testing</artifactId>
-    <version>3.2.1-SNAPSHOT</version>
+    <version>3.3.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-plugin-testing-harness</artifactId>

http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/6bf55326/maven-plugin-testing-tools/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugin-testing-tools/pom.xml b/maven-plugin-testing-tools/pom.xml
index 6253222..8eeff51 100644
--- a/maven-plugin-testing-tools/pom.xml
+++ b/maven-plugin-testing-tools/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven.plugin-testing</groupId>
     <artifactId>maven-plugin-testing</artifactId>
-    <version>3.2.1-SNAPSHOT</version>
+    <version>3.3.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-plugin-testing-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/6bf55326/maven-test-tools/pom.xml
----------------------------------------------------------------------
diff --git a/maven-test-tools/pom.xml b/maven-test-tools/pom.xml
index cea161f..7f215d8 100644
--- a/maven-test-tools/pom.xml
+++ b/maven-test-tools/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven.plugin-testing</groupId>
     <artifactId>maven-plugin-testing</artifactId>
-    <version>3.2.1-SNAPSHOT</version>
+    <version>3.3.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-test-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/6bf55326/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2a0172a..b2f8524 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@ under the License.
 
   <groupId>org.apache.maven.plugin-testing</groupId>
   <artifactId>maven-plugin-testing</artifactId>
-  <version>3.2.1-SNAPSHOT</version>
+  <version>3.3.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <name>Maven Plugin Testing</name>


[3/3] maven-plugin-testing git commit: MPLUGINTESTING-44 maven 3.2.4 compatibility

Posted by if...@apache.org.
MPLUGINTESTING-44 maven 3.2.4 compatibility

Signed-off-by: Igor Fedorenko <if...@apache.org>


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 <if...@apache.org>
Authored: Mon Nov 17 09:55:27 2014 -0500
Committer: Igor Fedorenko <if...@apache.org>
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


[2/3] maven-plugin-testing git commit: MPLUGINTESTING-44 enforce maven 3.2.4 as minimal supported version

Posted by if...@apache.org.
MPLUGINTESTING-44 enforce maven 3.2.4 as minimal supported version

Signed-off-by: Igor Fedorenko <if...@apache.org>


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/65c28851
Tree: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/tree/65c28851
Diff: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/diff/65c28851

Branch: refs/heads/master
Commit: 65c28851c702a295cdb0cd4014ad65fd530b9d30
Parents: 81f2998
Author: Igor Fedorenko <if...@apache.org>
Authored: Mon Nov 17 10:20:10 2014 -0500
Committer: Igor Fedorenko <if...@apache.org>
Committed: Mon Nov 17 10:51:14 2014 -0500

----------------------------------------------------------------------
 .../plugin/testing/AbstractMojoTestCase.java    | 37 ++++++++++++++++++++
 1 file changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/65c28851/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 9b49e71..8b047a7 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
@@ -34,9 +34,11 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import org.apache.commons.io.input.XmlStreamReader;
 import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
 import org.apache.maven.execution.DefaultMavenExecutionRequest;
 import org.apache.maven.execution.DefaultMavenExecutionResult;
 import org.apache.maven.execution.MavenExecutionRequest;
@@ -71,6 +73,7 @@ import org.codehaus.plexus.component.repository.ComponentDescriptor;
 import org.codehaus.plexus.configuration.PlexusConfiguration;
 import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
 import org.codehaus.plexus.logging.LoggerManager;
+import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.InterpolationFilterReader;
 import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.ReflectionUtils;
@@ -96,6 +99,37 @@ import com.google.inject.Module;
 public abstract class AbstractMojoTestCase
     extends PlexusTestCase
 {
+    private static final DefaultArtifactVersion MAVEN_VERSION;
+
+    static
+    {
+        DefaultArtifactVersion version = null;
+        String path = "/META-INF/maven/org.apache.maven/maven-core/pom.properties";
+        InputStream is = AbstractMojoTestCase.class.getResourceAsStream( path );
+        try
+        {
+            Properties properties = new Properties();
+            if ( is != null )
+            {
+                properties.load( is );
+            }
+            String property = properties.getProperty( "version" );
+            if ( property != null )
+            {
+                version = new DefaultArtifactVersion( property );
+            }
+        }
+        catch ( IOException e )
+        {
+            // odd, where did this come from
+        }
+        finally
+        {
+            IOUtil.close( is );
+        }
+        MAVEN_VERSION = version;
+    }
+
     private ComponentConfigurator configurator;
 
     private PlexusContainer container;
@@ -112,6 +146,9 @@ public abstract class AbstractMojoTestCase
     protected void setUp()
         throws Exception
     {
+        assertTrue( "Maven 3.2.4 or better is required",
+                    MAVEN_VERSION == null || new DefaultArtifactVersion( "3.2.3" ).compareTo( MAVEN_VERSION ) < 0 );
+
         configurator = getContainer().lookup( ComponentConfigurator.class, "basic" );
 
         InputStream is = getClass().getResourceAsStream( "/" + getPluginDescriptorLocation() );