MNG-588: Throw an exception if two index files already exist

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@225290 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vincent Siveton 2005-07-26 12:33:12 +00:00
parent 4b36d0a017
commit cbb5657526
1 changed files with 13 additions and 3 deletions

View File

@ -560,10 +560,20 @@ public class DoxiaMojo
if ( indexFound.size() > 1 ) if ( indexFound.size() > 1 )
{ {
// TODO throw an Exception? StringBuffer sb = new StringBuffer( "\n" );
getLog().warn( "More than one index file exists in the project site directory. Checks the result." ); for ( Iterator it = indexFound.iterator(); it.hasNext(); )
return true; {
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 ) if ( indexFound.size() == 1 )
{ {
getLog().warn( "One index file was found in the project site directory." ); getLog().warn( "One index file was found in the project site directory." );