blob: 8274de9f02ca6086f577e752147ef919a9154819 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.io.*;
boolean result = true;
try
{
File target = new File( basedir, "module2/target" );
if ( !target.exists() || !target.isDirectory() )
{
System.err.println( "module2/target file is missing or not a directory." );
return false;
}
File apidocs = new File( target, "apidocs" );
if ( !apidocs.exists() || !apidocs.isDirectory() )
{
System.err.println( "module2/target/apidocs file is missing or not a directory." );
return false;
}
// module3 must be included
File module3File = new File( apidocs, "org/apache/maven/plugin/javadoc/it/Module3Class.html" );
if ( !module3File.isFile() )
{
System.err.println( "module2/target/apidocs/org/apache/maven/plugin/javadoc/it/Module3Class.html file is missing or not a file." );
return false;
}
// el-api must be included
File elApiFile = new File( apidocs, "javax/el/ValueExpression.html" );
if ( !elApiFile.isFile() )
{
System.err.println( "module2/target/apidocs/javax/el/ValueExpression.html file is missing or not a file." );
return false;
}
// module1 must NOT be included
File module1File = new File( apidocs, "org/apache/maven/plugin/javadoc/it/Module1Class.html" );
if ( module1File.isFile() )
{
System.err.println( "module2/target/apidocs/org/apache/maven/plugin/javadoc/it/Module1Class.html file exists, but should not." );
return false;
}
// servlet-api must NOT be included
File servletSpecFile = new File( apidocs, "javax/servlet/ServletContext.html" );
if ( servletSpecFile.isFile() )
{
System.err.println( "module2/target/apidocs/javax/servlet/ServletContext.html file exists, but should not." );
return false;
}
}
catch( IOException e )
{
e.printStackTrace();
result = false;
}
return result;