mirror of https://github.com/apache/maven.git
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:
parent
4b36d0a017
commit
cbb5657526
|
@ -560,10 +560,20 @@ public class DoxiaMojo
|
|||
|
||||
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." );
|
||||
|
|
Loading…
Reference in New Issue