Check the directory creation

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@426003 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2006-07-27 08:27:02 +00:00
parent 3e8d1f934c
commit ef76da9daa
1 changed files with 13 additions and 3 deletions

View File

@ -136,7 +136,14 @@ public class Maven1Converter
pluginRelocator.relocate( v4Model );
}
writeV4Pom( v4Model );
try
{
writeV4Pom( v4Model );
}
catch ( IOException e )
{
throw new ProjectConverterException( "Failed to write the pom.xml.", e );
}
}
private boolean isEmpty( String value )
@ -260,14 +267,17 @@ public class Maven1Converter
* @throws ProjectConverterException
*/
private void writeV4Pom( Model v4Model )
throws ProjectConverterException
throws ProjectConverterException, IOException
{
if ( outputdir == null )
{
outputdir = basedir;
}
outputdir.mkdirs();
if ( !outputdir.exists() && !outputdir.mkdirs() )
{
throw new IOException( "Failed to create directory " + outputdir );
}
File pomxml = new File( outputdir, "pom.xml" );