[MNG-3141] only canonicalize paths on Windows (to prevent path length issues, but not obliterate symlinks on unix)

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@567954 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2007-08-21 04:54:04 +00:00
parent ca0450d220
commit 959ce3f30f
1 changed files with 12 additions and 6 deletions

View File

@ -57,6 +57,7 @@ import org.codehaus.plexus.context.ContextException;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.Os;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.dag.CycleDetectedException;
@ -498,13 +499,18 @@ public class DefaultMaven
moduleFile = new File( basedir, name + "/" + Maven.POMv4 );
}
try
if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
{
moduleFile = moduleFile.getCanonicalFile();
}
catch ( IOException e )
{
throw new MavenExecutionException( "Unable to canonicalize file name " + moduleFile, e );
// we don't canonicalize on unix to avoid interfering with symlinks
try
{
moduleFile = moduleFile.getCanonicalFile();
}
catch ( IOException e )
{
throw new MavenExecutionException( "Unable to canonicalize file name " + moduleFile, e );
}
}
moduleFiles.add( moduleFile );