Skip to content

Commit

Permalink
o Improved robustness
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@895291 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bentmann committed Jan 2, 2010
1 parent a5b2dd1 commit 9f217fd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
12 changes: 10 additions & 2 deletions maven-core/src/main/java/org/apache/maven/DefaultMaven.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,15 @@ private ProjectDependencyGraph createDependencyGraph( ProjectSorter sorter, Mave

Collection<MavenProject> activeProjects = sorter.getSortedProjects();

File reactorDirectory = request.getPom().getAbsoluteFile().getParentFile();
File reactorDirectory;
if ( request.getBaseDirectory() != null )
{
reactorDirectory = new File( request.getBaseDirectory() );
}
else
{
reactorDirectory = null;
}

if ( !request.getSelectedProjects().isEmpty() )
{
Expand Down Expand Up @@ -596,7 +604,7 @@ private boolean isMatchingProject( MavenProject project, String selector, File r
}

// relative path, e.g. "sub", "../sub" or "."
else
else if ( reactorDirectory != null )
{
File selectedProject = new File( new File( reactorDirectory, selector ).toURI().normalize() );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,22 @@ public ArtifactRepository createLocalRepository( MavenExecutionRequest request )
}
}

private void baseDirectory( MavenExecutionRequest request )
{
if ( request.getBaseDirectory() == null )
{
if ( request.getPom() != null )
{
request.setBaseDirectory( request.getPom().getAbsoluteFile().getParentFile() );
}
}
}

public MavenExecutionRequest populateDefaults( MavenExecutionRequest request )
throws MavenExecutionRequestPopulationException
{
baseDirectory( request );

localRepository( request );

populateDefaultPluginGroups( request );
Expand Down

0 comments on commit 9f217fd

Please sign in to comment.