Author: bentmann
Date: Thu Mar 25 17:01:40 2010
New Revision: 927498
URL: http://svn.apache.org/viewvc?rev=927498&view=rev
Log:
[MNG-3297] maven should not give dependencies to plugins that don't
@requireDependencyResolution
o Added IT
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java
(with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3297/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3297/pom.xml
(with props)
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=927498&r1=927497&r2=927498&view=diff
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
(original)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
Thu Mar 25 17:01:40 2010
@@ -351,6 +351,7 @@ public class IntegrationTestSuite
suite.addTestSuite(
MavenITmng3355TranslatedPathInterpolationTest.class );
suite.addTestSuite( MavenITmng3331ModulePathNormalizationTest.class );
suite.addTestSuite( MavenITmng3314OfflineSnapshotsTest.class );
+ suite.addTestSuite(
MavenITmng3297DependenciesNotLeakedToMojoTest.class );
suite.addTestSuite( MavenITmng3288SystemScopeDirTest.class );
suite.addTestSuite( MavenITmng3284UsingCachedPluginsTest.class );
suite.addTestSuite( MavenITmng3271DefaultReportsSuppressionTest.class
);
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java?rev=927498&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java
(added)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java
Thu Mar 25 17:01:40 2010
@@ -0,0 +1,66 @@
+package org.apache.maven.it;
+
+/*
+ * 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 org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * This is a test set for <a
href="http://jira.codehaus.org/browse/MNG-3297">MNG-3297</a>.
+ *
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng3297DependenciesNotLeakedToMojoTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng3297DependenciesNotLeakedToMojoTest()
+ {
+ super( "[3.0-alpha-7,)" );
+ }
+
+ /**
+ * Test that project dependencies resolved for one mojo are not exposed to
another mojo if the latter
+ * does not require dependency resolution.
+ */
+ public void testit()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/mng-3297" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.executeGoal( "initialize" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ List artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" );
+ assertEquals( artifacts.toString(), 1, artifacts.size() );
+
+ Properties props = verifier.loadProperties(
"target/artifact.properties" );
+ assertEquals( "0", props.getProperty( "project.artifacts" ) );
+ }
+
+}
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3297/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3297/pom.xml?rev=927498&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3297/pom.xml
(added)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3297/pom.xml
Thu Mar 25 17:01:40 2010
@@ -0,0 +1,85 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.mng3297</groupId>
+ <artifactId>test</artifactId>
+ <version>0.1</version>
+
+ <name>Maven Integration Test :: MNG-3297</name>
+ <description>
+ Test that project dependencies resolved for one mojo are not exposed to
another mojo if the latter
+ does not require dependency resolution.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core-it-support</artifactId>
+ <version>1.0</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-dependency-resolution</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>resolve</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <projectArtifacts>target/artifacts.txt</projectArtifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-expression</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>no-resolve</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>eval</goal>
+ </goals>
+ <configuration>
+ <outputFile>target/artifact.properties</outputFile>
+ <expressions>
+ <expression>project/artifacts</expression>
+ </expressions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3297/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3297/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision