You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2005/10/12 14:44:25 UTC

svn commit: r314864 - in /maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant: AntBuildWriter.java AntMojo.java AntPluginException.java

Author: brett
Date: Wed Oct 12 05:44:21 2005
New Revision: 314864

URL: http://svn.apache.org/viewcvs?rev=314864&view=rev
Log:
remove unneeded exception in ant plugin

Removed:
    maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntPluginException.java
Modified:
    maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
    maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntMojo.java

Modified: maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java?rev=314864&r1=314863&r2=314864&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java (original)
+++ maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java Wed Oct 12 05:44:21 2005
@@ -49,7 +49,7 @@
     }
 
     public void write()
-        throws AntPluginException
+        throws IOException
     {
         writeBuildXml();
 
@@ -62,19 +62,12 @@
     // ----------------------------------------------------------------------
 
     protected void writeBuildXml()
-        throws AntPluginException
+        throws IOException
     {
         FileWriter w;
 
-        try
-        {
-            // TODO: parameter
-            w = new FileWriter( new File( project.getBasedir(), "build.xml" ) );
-        }
-        catch ( IOException ex )
-        {
-            throw new AntPluginException( "Exception while opening file.", ex );
-        }
+        // TODO: parameter
+        w = new FileWriter( new File( project.getBasedir(), "build.xml" ) );
 
         XMLWriter writer = new PrettyPrintXMLWriter( w );
 
@@ -410,13 +403,13 @@
             String path = toRelative( localRepository, artifact.getFile().getPath() );
 
             File parentDirs = new File( path ).getParentFile();
-            if ( parentDirs != null ) 
+            if ( parentDirs != null )
             {
                 writer.startElement( "mkdir" );
                 writer.addAttribute( "dir", parentDirs.getAbsolutePath() );
                 writer.endElement(); // mkdir
             }
-            
+
             for ( Iterator j = project.getRepositories().iterator(); j.hasNext(); )
             {
                 Repository repository = (Repository) j.next();

Modified: maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntMojo.java?rev=314864&r1=314863&r2=314864&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntMojo.java (original)
+++ maven/components/trunk/maven-plugins/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntMojo.java Wed Oct 12 05:44:21 2005
@@ -22,9 +22,11 @@
 import org.apache.maven.project.MavenProject;
 
 import java.io.File;
+import java.io.IOException;
 
 /**
  * A Maven2 plugin to generate an Ant build file.
+ *
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @version $Id$
  * @goal ant
@@ -36,6 +38,7 @@
 {
     /**
      * The project to create a build for.
+     *
      * @parameter expression="${project}"
      * @required
      */
@@ -43,6 +46,7 @@
 
     /**
      * The location of the local repository.
+     *
      * @parameter expression="${localRepository}"
      * @required
      */
@@ -59,7 +63,7 @@
         {
             antBuildWriter.write();
         }
-        catch ( AntPluginException e )
+        catch ( IOException e )
         {
             throw new MojoExecutionException( "Error building Ant script", e );
         }