maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit CoreItMojo.java
Date Tue, 22 Mar 2005 06:43:31 GMT
brett       2005/03/21 22:43:31

  Modified:    maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit
                        CoreItMojo.java
  Log:
  can't be half and half! move to new plugin model
  
  Revision  Changes    Path
  1.5       +22 -15    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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CoreItMojo.java	22 Mar 2005 06:38:50 -0000	1.4
  +++ CoreItMojo.java	22 Mar 2005 06:43:31 -0000	1.5
  @@ -17,9 +17,9 @@
    */
   
   import org.apache.maven.plugin.AbstractPlugin;
  -import org.apache.maven.plugin.PluginExecutionRequest;
  -import org.apache.maven.plugin.PluginExecutionResponse;
  +import org.apache.maven.plugin.PluginExecutionException;
   
  +import java.io.IOException;
   import java.io.File;
   import java.io.FileWriter;
   
  @@ -60,8 +60,8 @@
   
       private String goalItem;
   
  -    public void execute( PluginExecutionRequest request, PluginExecutionResponse response
)
  -        throws Exception
  +    public void execute()
  +        throws PluginExecutionException
       {
           touch( new File( outputDirectory ), "touch.txt" );
   
  @@ -83,19 +83,26 @@
       }
   
       private static void touch( File dir, String file )
  -        throws Exception
  +        throws PluginExecutionException
       {
  -        if ( !dir.exists() )
  +        try
           {
  -            dir.mkdirs();
  +             if ( !dir.exists() )
  +             {
  +                 dir.mkdirs();
  +             }
  +             
  +             File touch = new File( dir, file );
  +     
  +             FileWriter w = new FileWriter( touch );
  +             
  +             w.write( file );
  +             
  +             w.close();
  +        }
  +        catch ( IOException e )
  +        {
  +            throw new PluginExecutionException( "Error touching file", e );
           }
  -        
  -        File touch = new File( dir, file );
  -
  -        FileWriter w = new FileWriter( touch );
  -        
  -        w.write( file );
  -        
  -        w.close();
       }
   }
  
  
  

Mime
View raw message