Index: DefaultMaven.java =================================================================== --- DefaultMaven.java (revision 563893) +++ DefaultMaven.java (working copy) @@ -512,14 +512,17 @@ moduleFile = new File( basedir, name + "/" + Maven.POMv4 ); } - try + if ( !isSymLink( moduleFile )) { - moduleFile = moduleFile.getCanonicalFile(); + try + { + moduleFile = moduleFile.getCanonicalFile(); + } + catch ( IOException e ) + { + throw new MavenExecutionException( "Unable to canonicalize file name " + moduleFile, e ); + } } - catch ( IOException e ) - { - throw new MavenExecutionException( "Unable to canonicalize file name " + moduleFile, e ); - } moduleFiles.add( moduleFile ); } @@ -535,6 +538,20 @@ return projects; } + private boolean isSymLink( File file ) throws MavenExecutionException + { + File dir = file.getParentFile(); + try + { + return !file.getCanonicalPath().startsWith( dir.getCanonicalPath() ); + } + catch ( IOException e ) + { + throw new MavenExecutionException( "Error checking whether file: " + file + + "is a symbolic link. Error: " + e.getMessage(), e ); + } + } + public MavenProject getProject( File pom, ArtifactRepository localRepository, Settings settings,