use plugin-plugin 2.9 for this mojo

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@1413516 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-11-26 09:00:59 +00:00
parent 51b8c1ea7d
commit 48087a56e0
2 changed files with 30 additions and 4 deletions

View File

@ -45,4 +45,17 @@ under the License.
<version>2.0</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.9</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -35,9 +35,7 @@ public class CoreItMojoWithSetters
extends AbstractMojo
{
/**
* @parameter
* property="outputDirectory"
* expression="${project.build.directory}"
* @parameter expression="${project.build.directory}"
* @required
*/
private String outputDirectoryValue;
@ -65,6 +63,9 @@ public void setOutputDirectory( String outputDirectory )
public void setFoo( String fooValue )
{
getLog().info( "setFoo: " + fooValue );
this.fooValue = fooValue;
setFooSetterExecuted = true;
@ -74,6 +75,9 @@ public void setFoo( String fooValue )
public void setBar( String barValue )
{
getLog().info( "setBar: " + barValue );
this.bar = barValue + ".baz";
setBarSetterExecuted = true;
@ -94,18 +98,27 @@ public void execute()
// Test parameter setting
if ( fooValue != null && setFooSetterExecuted )
{
getLog().info( "fooValue != null && setFooSetterExecuted" );
touch( outDir, fooValue );
}
if ( bar != null && setBarSetterExecuted )
{
getLog().info( "bar != null && setBarSetterExecuted" );
touch( outDir, bar );
}
}
private static void touch( File dir, String file )
private void touch( File dir, String file )
throws MojoExecutionException
{
getLog().info( "touch: " + dir.getPath() + ":" + file );
try
{
if ( !dir.exists() )