o adding a couple more checked to make sure the setters are executed.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@280000 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2005-09-10 12:58:03 +00:00
parent 843ed8061a
commit 6b442c75a9
1 changed files with 11 additions and 3 deletions

View File

@ -20,7 +20,7 @@ public class CoreItMojoWithSetters
{ {
/** /**
* @parameter * @parameter
* property="outputDirectoryValue" * property="outputDirectory"
* expression="${project.build.directory}" * expression="${project.build.directory}"
* @required * @required
*/ */
@ -45,14 +45,22 @@ public class CoreItMojoWithSetters
this.outputDirectoryValue = outputDirectory; this.outputDirectoryValue = outputDirectory;
} }
boolean setFooSetterExecuted;
public void setFoo( String fooValue ) public void setFoo( String fooValue )
{ {
this.fooValue = fooValue; this.fooValue = fooValue;
setFooSetterExecuted = true;
} }
boolean setBarSetterExecuted;
public void setBar( String barValue ) public void setBar( String barValue )
{ {
this.barValue = barValue; this.barValue = barValue;
setBarSetterExecuted = true;
} }
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
@ -68,12 +76,12 @@ public class CoreItMojoWithSetters
File outDir = new File( outputDirectoryValue ); File outDir = new File( outputDirectoryValue );
// Test parameter setting // Test parameter setting
if ( fooValue != null ) if ( fooValue != null && setFooSetterExecuted )
{ {
touch( outDir, fooValue ); touch( outDir, fooValue );
} }
if ( barValue != null ) if ( barValue != null && setBarSetterExecuted )
{ {
touch( outDir, barValue ); touch( outDir, barValue );
} }