You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/06/12 22:35:43 UTC
svn commit: r784264 - in
/maven/core-integration-testing/trunk/core-it-suite/src/test:
java/org/apache/maven/it/
resources/mng-3394/lifecycleMojoVersionInPluginMgmt/
resources/mng-3394/preferBuildPluginOverPluginMgmt/
Author: bentmann
Date: Fri Jun 12 20:35:43 2009
New Revision: 784264
URL: http://svn.apache.org/viewvc?rev=784264&view=rev
Log:
o Decoupled IT from production plugins
Removed:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/lifecycleMojoVersionInPluginMgmt/readme.txt
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/preferBuildPluginOverPluginMgmt/readme.txt
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3394POMPluginVersionDominanceTest.java
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/lifecycleMojoVersionInPluginMgmt/pom.xml
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/preferBuildPluginOverPluginMgmt/pom.xml
Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3394POMPluginVersionDominanceTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3394POMPluginVersionDominanceTest.java?rev=784264&r1=784263&r2=784264&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3394POMPluginVersionDominanceTest.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3394POMPluginVersionDominanceTest.java Fri Jun 12 20:35:43 2009
@@ -51,75 +51,31 @@
//testShouldUsePluginVersionFromPluginMgmtForLifecycleMojoWhenNotInBuildPlugins
File testDir = ResourceExtractor.simpleExtractResources( getClass(), BASEDIR_PREFIX + "lifecycleMojoVersionInPluginMgmt" );
- Verifier verifier;
-
- verifier = new Verifier( testDir.getAbsolutePath() );
-
- verifier.setCliOptions( Collections.singletonList( "-X" ) );
-
- verifier.executeGoal( "install" );
-
- /*
- * This is the simplest way to check a build
- * succeeded. It is also the simplest way to create
- * an IT test: make the build pass when the test
- * should pass, and make the build fail when the
- * test should fail. There are other methods
- * supported by the verifier. They can be seen here:
- * http://maven.apache.org/shared/maven-verifier/apidocs/index.html
- */
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.executeGoal( "process-resources" );
verifier.verifyErrorFreeLog();
-
- List logFile = verifier.loadFile( new File( testDir, "log.txt" ), false );
-
- boolean foundSiteBeta5 = false;
- for ( Iterator it = logFile.iterator(); it.hasNext(); )
- {
- String line = (String) it.next();
- if ( line.indexOf( "maven-site-plugin:2.0-beta-5" ) > -1 )
- {
- foundSiteBeta5 = true;
- break;
- }
- }
-
- /*
- * Reset the streams before executing the verifier
- * again.
- */
verifier.resetStreams();
- assertTrue( "No reference to maven-site-plugin, version 2.0-beta-5 found in build log.", foundSiteBeta5 );
+ verifier.assertFilePresent( "target/resources-resources.txt" );
}
- public void testitMNG3394b ()
+ public void testitMNG3394b()
throws Exception
{
//testShouldPreferPluginVersionFromBuildPluginsOverThatInPluginMgmt
File testDir = ResourceExtractor.simpleExtractResources( getClass(), BASEDIR_PREFIX + "preferBuildPluginOverPluginMgmt" );
- Verifier verifier;
-
- verifier = new Verifier( testDir.getAbsolutePath() );
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
verifier.executeGoal( "clean" );
-
- /*
- * This is the simplest way to check a build
- * succeeded. It is also the simplest way to create
- * an IT test: make the build pass when the test
- * should pass, and make the build fail when the
- * test should fail. There are other methods
- * supported by the verifier. They can be seen here:
- * http://maven.apache.org/shared/maven-verifier/apidocs/index.html
- */
verifier.verifyErrorFreeLog();
-
- /*
- * Reset the streams before executing the verifier
- * again.
- */
verifier.resetStreams();
+
+ verifier.assertFilePresent( "target/clean-clean.txt" );
}
+
}
Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/lifecycleMojoVersionInPluginMgmt/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/lifecycleMojoVersionInPluginMgmt/pom.xml?rev=784264&r1=784263&r2=784264&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/lifecycleMojoVersionInPluginMgmt/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/lifecycleMojoVersionInPluginMgmt/pom.xml Fri Jun 12 20:35:43 2009
@@ -1,18 +1,25 @@
<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>org.apache.maven.its.mng3394</groupId>
<artifactId>lifecycleMojoVersionInPluginMgmt</artifactId>
- <packaging>pom</packaging>
<version>1</version>
- <name>lifecycleMojoVersionInPluginMgmt</name>
+ <packaging>jar</packaging>
+
+ <name>Maven Integration Test :: MNG-3394</name>
+ <description>
+ This test should verify that the Resources Plugin version used is 0.1-stub, not the latest one. It should
+ get this version from the POM's pluginManagement section, even though the plugin's mojo call is coming from
+ the default lifecycle bindings, and the plugin is not specified in the POM's build/plugins section.
+ </description>
<build>
<pluginManagement>
<plugins>
<plugin>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-5</version>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>0.1-stub-SNAPSHOT</version>
</plugin>
</plugins>
</pluginManagement>
Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/preferBuildPluginOverPluginMgmt/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/preferBuildPluginOverPluginMgmt/pom.xml?rev=784264&r1=784263&r2=784264&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/preferBuildPluginOverPluginMgmt/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3394/preferBuildPluginOverPluginMgmt/pom.xml Fri Jun 12 20:35:43 2009
@@ -1,10 +1,18 @@
<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>org.apache.maven.its.mng3394</groupId>
<artifactId>preferBuildPluginOverPluginMgmt</artifactId>
- <packaging>jar</packaging>
<version>1</version>
+ <packaging>jar</packaging>
+
+ <name>Maven Integration Test :: MNG-3394</name>
+ <description>
+ Test that the plugin version given in project/build/plugins overrides that in project/build/pluginManagement/plugins.
+ If this is correct, the clean plugin should find a valid version, and execute. Otherwise, the version 'invalid' is
+ used by Maven, and the clean plugin with that version cannot be resolved...so the build fails. Use `mvn clean` to test.
+ </description>
<build>
<pluginManagement>
@@ -18,7 +26,7 @@
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
- <version>2.1.1</version>
+ <version>0.1-stub-SNAPSHOT</version>
</plugin>
</plugins>
</build>