maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-components/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit CoreItMojo.java
Date Sun, 13 Mar 2005 21:06:06 GMT
jvanzyl     2005/03/13 13:06:06

  Modified:    maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit
                        CoreItMojo.java
  Log:
  o added mojo parameter which states that its type is "java.io.File" to test
    the basedir alignment of mojo parameters.
  
  Revision  Changes    Path
  1.3       +30 -1     maven-components/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
  
  Index: CoreItMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CoreItMojo.java	28 Feb 2005 23:37:19 -0000	1.2
  +++ CoreItMojo.java	13 Mar 2005 21:06:06 -0000	1.3
  @@ -25,6 +25,7 @@
   
   /**
    * @goal touch
  + * 
    * @phase process-sources
    *
    * @description Goal which cleans the build
  @@ -36,6 +37,14 @@
    *  validator=""
    *  expression="#project.build.directory"
    *  description=""
  + * 
  + * @parameter
  + *  name="basedirAlignmentDirectory"
  + *  type="java.io.File"
  + *  required="true"
  + *  validator=""
  + *  expression="target/test-basedir-alignment"
  + *  description=""
    */
   public class CoreItMojo
       extends AbstractPlugin
  @@ -60,6 +69,26 @@
           
           w.write( "touch.txt" );
           
  -        w.close();                
  +        w.close();
  +        
  +        // This parameter should be aligned to the basedir as the parameter type is specified
  +        // as java.io.File
  +        
  +        String basedirAlignmentDirectory = (String) request.getParameter( "basedirAlignmentDirectory"
);
  +
  +        f = new File( basedirAlignmentDirectory );
  +        
  +        if ( !f.exists() )
  +        {
  +            f.mkdirs();
  +        }         
  +        
  +        touch = new File( f, "touch.txt" );
  +        
  +        w = new FileWriter( touch );
  +        
  +        w.write( "touch.txt" );
  +        
  +        w.close();        
       }
   }
  
  
  

Mime
View raw message