Author: brett
Date: Thu Feb 28 22:52:41 2008
New Revision: 632238
URL: http://svn.apache.org/viewvc?rev=632238&view=rev
Log:
[MNG-2339] enhance the interpolation test
Modified:
maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-project-interpolation/pom.xml
maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-project-interpolation/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng2339BadProjectInterpolationTest.java
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-2339-badProjectInterpolation/pom.xml
Modified:
maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-project-interpolation/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-project-interpolation/pom.xml?rev=632238&r1=632237&r2=632238&view=diff
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-project-interpolation/pom.xml
(original)
+++
maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-project-interpolation/pom.xml
Thu Feb 28 22:52:41 2008
@@ -34,6 +34,11 @@
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0</version>
+ </dependency>
<!-- Test the resolution of the version -->
<dependency>
<groupId>org.apache.maven.its</groupId>
Modified:
maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-project-interpolation/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-project-interpolation/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java?rev=632238&r1=632237&r2=632238&view=diff
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-project-interpolation/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
(original)
+++
maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-project-interpolation/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
Thu Feb 28 22:52:41 2008
@@ -19,20 +19,36 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
/**
- * @goal touch
+ * @goal check
*
- * @phase process-sources
+ * @phase validate
*
* @description Goal which cleans the build
*/
public class CoreItMojo
extends AbstractMojo
{
+ /** @parameter */
+ private String myDirectory;
+
+ /** @parameter expression="${project}" */
+ private MavenProject project;
+
public void execute()
throws MojoExecutionException
{
- getLog().info( "Don't touch me!" );
+ if ( !myDirectory.equals( project.getBasedir() + "/target/foo" ) )
+ {
+ throw new MojoExecutionException( "wrong directory: " +
myDirectory );
+ }
+
+ String value = project.getProperties().getProperty( "myDirectory" );
+ if ( !value.equals( "${project.build.directory}/foo" ) )
+ {
+ throw new MojoExecutionException( "wrong directory: " + value );
+ }
}
}
Modified:
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng2339BadProjectInterpolationTest.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng2339BadProjectInterpolationTest.java?rev=632238&r1=632237&r2=632238&view=diff
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng2339BadProjectInterpolationTest.java
(original)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng2339BadProjectInterpolationTest.java
Thu Feb 28 22:52:41 2008
@@ -48,7 +48,7 @@
List cliOptions = new ArrayList();
cliOptions.add( "-Dversion=foo" );
verifier.setCliOptions( cliOptions );
- verifier.executeGoal( "process-sources" );
+ verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
Modified:
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-2339-badProjectInterpolation/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-2339-badProjectInterpolation/pom.xml?rev=632238&r1=632237&r2=632238&view=diff
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-2339-badProjectInterpolation/pom.xml
(original)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-2339-badProjectInterpolation/pom.xml
Thu Feb 28 22:52:41 2008
@@ -9,14 +9,20 @@
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-project-interpolation</artifactId>
<version>2.1-SNAPSHOT</version>
+ <configuration>
+ <myDirectory>${myDirectory}</myDirectory>
+ </configuration>
<executions>
<execution>
<goals>
- <goal>touch</goal>
+ <goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
+ <properties>
+ <myDirectory>${project.build.directory}/foo</myDirectory>
+ </properties>
</project>