From 77c240c49ed6b97a8aa76f6b069adbd6218207dd Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Tue, 2 Jun 2009 22:43:41 +0000 Subject: [PATCH] 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 --- .../src/main/java/org/apache/maven/DefaultMaven.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java index f6f786772c..32adac8d8c 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -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 projects; + //TODO: optimize for the single project or no project + try { projects = getProjects( request ); @@ -176,6 +180,13 @@ public class DefaultMaven protected Map getProjects( MavenExecutionRequest request ) throws MavenExecutionException, ProjectBuildingException { + // We have no POM file. + // + if ( request.getPom() == null || !request.getPom().exists() ) + { + return new HashMap(); + } + List files = Arrays.asList( request.getPom().getAbsoluteFile() ); Map projects = collectProjects( files, request );