[MNG-4262] Make-like reactor mode fails to find projects selected by relative paths with leading dots

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@798466 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-07-28 09:26:51 +00:00
parent e3f7710578
commit 0cefc46991
1 changed files with 26 additions and 18 deletions

View File

@ -437,6 +437,9 @@ public class DefaultMaven
}
private boolean isMatchingProject( MavenProject project, String selector, File reactorDirectory )
{
// [groupId]:artifactId
if ( selector.indexOf( ':' ) >= 0 )
{
String id = ':' + project.getArtifactId();
@ -451,8 +454,12 @@ public class DefaultMaven
{
return true;
}
}
File selectedProject = new File( reactorDirectory, selector );
// relative path, e.g. "sub", "../sub" or "."
else
{
File selectedProject = new File( new File( reactorDirectory, selector ).toURI().normalize() );
if ( selectedProject.isFile() )
{
@ -462,6 +469,7 @@ public class DefaultMaven
{
return selectedProject.equals( project.getBasedir() );
}
}
return false;
}