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 2015/03/10 15:39:02 UTC

[1/2] maven-integration-testing git commit: MNG-5783 let some tests resolve dependencies from remote repository

Repository: maven-integration-testing
Updated Branches:
  refs/heads/master 987fdbcaf -> be0edcfb6


MNG-5783 let some tests resolve dependencies from remote repository

Artifact filtering moved from plugin dependency resolver to class
realm manager. This means more artifact jars need to be available
for the tests to run successfully. Not quite sure how this worked
before because dependency poms were supposed to be resolved even
before this change.

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


Project: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/commit/638261bb
Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/638261bb
Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/638261bb

Branch: refs/heads/master
Commit: 638261bb41aac72e34dce7cf68484cb0bfd45bcd
Parents: 987fdbc
Author: Igor Fedorenko <if...@apache.org>
Authored: Tue Mar 10 10:31:29 2015 -0400
Committer: Igor Fedorenko <if...@apache.org>
Committed: Tue Mar 10 10:31:29 2015 -0400

----------------------------------------------------------------------
 .../it/MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.java  | 2 +-
 .../java/org/apache/maven/it/MavenITmng5482AetherNotFoundTest.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/638261bb/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.java
index 93127bd..0639eb0 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.java
@@ -51,7 +51,7 @@ public class MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4528" );
 
-        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        Verifier verifier = newVerifier( testDir.getAbsolutePath(), "remote" );
         verifier.setAutoclean( false );
         verifier.deleteDirectory( "target" );
         verifier.executeGoal( "validate" );

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/638261bb/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5482AetherNotFoundTest.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5482AetherNotFoundTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5482AetherNotFoundTest.java
index e1f15fe..60a85c9 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5482AetherNotFoundTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5482AetherNotFoundTest.java
@@ -66,7 +66,7 @@ public class MavenITmng5482AetherNotFoundTest
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5482/" + dir );
 
-        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        Verifier verifier = newVerifier( testDir.getAbsolutePath(), "remote" );
         verifier.setAutoclean( false );
 
         try


[2/2] maven-integration-testing git commit: MNG-5783 test plugin.artifacts can include slf4j

Posted by if...@apache.org.
MNG-5783 test plugin.artifacts can include slf4j

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


Project: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/commit/be0edcfb
Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/be0edcfb
Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/be0edcfb

Branch: refs/heads/master
Commit: be0edcfb6b3a0195b1d0218c1b5e67dbce60133c
Parents: 638261b
Author: Igor Fedorenko <if...@apache.org>
Authored: Tue Mar 10 10:37:41 2015 -0400
Committer: Igor Fedorenko <if...@apache.org>
Committed: Tue Mar 10 10:37:41 2015 -0400

----------------------------------------------------------------------
 .../apache/maven/it/IntegrationTestSuite.java   |  1 +
 ...MavenITmng5783PluginDependencyFiltering.java | 40 +++++++++++
 .../plugin/pom.xml                              | 55 +++++++++++++++
 .../maven/its/mng5783/plugin/TestMojo.java      | 72 ++++++++++++++++++++
 .../slf4j/pom.xml                               | 55 +++++++++++++++
 5 files changed, 223 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/be0edcfb/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index f3baf59..98e5752 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -106,6 +106,7 @@ public class IntegrationTestSuite
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng5783PluginDependencyFiltering.class );
         suite.addTestSuite( MavenITmng5774ConfigurationProcessorsTest.class );
         suite.addTestSuite( MavenITmng5771CoreExtensionsTest.class );
         suite.addTestSuite( MavenITmng5768CliExecutionIdTest.class );

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/be0edcfb/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5783PluginDependencyFiltering.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5783PluginDependencyFiltering.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5783PluginDependencyFiltering.java
new file mode 100644
index 0000000..4984954
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5783PluginDependencyFiltering.java
@@ -0,0 +1,40 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+public class MavenITmng5783PluginDependencyFiltering
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng5783PluginDependencyFiltering()
+    {
+        super( "[3.0,)" );
+    }
+
+    public void testSLF4j()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5783-plugin-dependency-filtering" );
+        Verifier verifier = newVerifier( new File( testDir, "plugin" ).getAbsolutePath() );
+        verifier.executeGoal( "install" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        verifier = newVerifier( new File( testDir, "slf4j" ).getAbsolutePath(), "remote" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        // Note that plugin dependencies always include plugin itself and plexus-utils
+
+        List<String> dependencies = verifier.loadLines( "target/dependencies.txt", "UTF-8" );
+        assertEquals( 3, dependencies.size() );
+        assertEquals( "mng-5783-plugin-dependency-filtering:mng-5783-plugin-dependency-filtering-plugin:maven-plugin:0.1",
+                      dependencies.get( 0 ) );
+        assertEquals( "org.slf4j:slf4j-api:jar:1.7.5", dependencies.get( 1 ) );
+        assertEquals( "org.codehaus.plexus:plexus-utils:jar:1.1", dependencies.get( 2 ) );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/be0edcfb/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/plugin/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/plugin/pom.xml b/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/plugin/pom.xml
new file mode 100644
index 0000000..94191df
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/plugin/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>mng-5783-plugin-dependency-filtering</groupId>
+  <artifactId>mng-5783-plugin-dependency-filtering-plugin</artifactId>
+  <version>0.1</version>
+  <packaging>maven-plugin</packaging>
+
+  <properties>
+    <maven-version>3.2.5</maven-version>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>${maven-version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+      <version>${maven-version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>${maven-version}</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/be0edcfb/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/plugin/src/main/java/org/apache/maven/its/mng5783/plugin/TestMojo.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/plugin/src/main/java/org/apache/maven/its/mng5783/plugin/TestMojo.java b/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/plugin/src/main/java/org/apache/maven/its/mng5783/plugin/TestMojo.java
new file mode 100644
index 0000000..00faa65
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/plugin/src/main/java/org/apache/maven/its/mng5783/plugin/TestMojo.java
@@ -0,0 +1,72 @@
+package org.apache.maven.its.mng5783.plugin;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * @goal test
+ */
+public class TestMojo
+    extends AbstractMojo
+{
+    /** @parameter property="project.build.directory" */
+    private File outputDirectory;
+
+    /** @parameter property="plugin.artifacts" */
+    private List<Artifact> artifacts;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        try
+        {
+            File file = new File( outputDirectory, "dependencies.txt" );
+            file.getParentFile().mkdirs();
+            BufferedWriter w = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( file ), "UTF-8" ) );
+            try
+            {
+                for ( Artifact artifact : artifacts )
+                {
+                    w.write( artifact.getId() );
+                    w.newLine();
+                }
+            }
+            finally
+            {
+                w.close();
+            }
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( e.getMessage(), e );
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/be0edcfb/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/slf4j/pom.xml b/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/slf4j/pom.xml
new file mode 100644
index 0000000..94164db
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5783-plugin-dependency-filtering/slf4j/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>mng-5783-plugin-dependency-filtering</groupId>
+  <artifactId>mng-5783-plugin-dependency-filtering-slf4j</artifactId>
+  <version>0.1</version>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>mng-5783-plugin-dependency-filtering</groupId>
+        <artifactId>mng-5783-plugin-dependency-filtering-plugin</artifactId>
+        <version>0.1</version>
+        <executions>
+          <execution>
+            <id>test</id>
+            <goals>
+              <goal>test</goal>
+            </goals>
+            <phase>validate</phase>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.7.5</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+    </plugins>
+  </build>
+</project>