You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by vs...@apache.org on 2005/07/26 14:33:14 UTC

svn commit: r225290 - /maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java

Author: vsiveton
Date: Tue Jul 26 05:33:12 2005
New Revision: 225290

URL: http://svn.apache.org/viewcvs?rev=225290&view=rev
Log:
MNG-588: Throw an exception if two index files already exist

Modified:
    maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java

Modified: maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java?rev=225290&r1=225289&r2=225290&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java (original)
+++ maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java Tue Jul 26 05:33:12 2005
@@ -560,10 +560,20 @@
 
         if ( indexFound.size() > 1 )
         {
-            // TODO throw an Exception?
-            getLog().warn( "More than one index file exists in the project site directory. Checks the result." );
-            return true;
+            StringBuffer sb = new StringBuffer( "\n" );
+            for ( Iterator it = indexFound.iterator(); it.hasNext(); )
+            {
+                sb.append( " * " );
+                sb.append( ( (File) it.next() ).getAbsolutePath() );
+                if ( it.hasNext() )
+                {
+                    sb.append( "\n" );
+                }
+            }
+            throw new MavenReportException( "More than one index file exists in the project site directory. "
+                + "You have to delete one of these files: " + sb.toString() );
         }
+
         if ( indexFound.size() == 1 )
         {
             getLog().warn( "One index file was found in the project site directory." );



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org