o deal with no pom being used for execution correctly

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@781197 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2009-06-02 22:43:41 +00:00
parent 2d7b1977d9
commit 77c240c49e
1 changed files with 11 additions and 0 deletions

View File

@ -20,7 +20,9 @@ import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -93,6 +95,8 @@ public class DefaultMaven
Map<String,MavenProject> projects;
//TODO: optimize for the single project or no project
try
{
projects = getProjects( request );
@ -176,6 +180,13 @@ public class DefaultMaven
protected Map<String,MavenProject> getProjects( MavenExecutionRequest request )
throws MavenExecutionException, ProjectBuildingException
{
// We have no POM file.
//
if ( request.getPom() == null || !request.getPom().exists() )
{
return new HashMap<String,MavenProject>();
}
List<File> files = Arrays.asList( request.getPom().getAbsoluteFile() );
Map<String,MavenProject> projects = collectProjects( files, request );