From 605227abb7801f76f6f3c26f05bcd2bc9b29b8cf Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sat, 2 Jun 2007 22:38:40 +0000 Subject: [PATCH] MNG-2860 Don't fly out of control when we encounter in a POM git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@543797 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/DefaultMaven.java | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) 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 278fdf9a62..a9b03c1ced 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -25,15 +25,7 @@ import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.context.BuildContextManager; import org.apache.maven.context.SystemBuildContext; -import org.apache.maven.execution.BuildFailure; -import org.apache.maven.execution.DefaultMavenExecutionResult; -import org.apache.maven.execution.ExecutionBuildContext; -import org.apache.maven.execution.MavenExecutionRequest; -import org.apache.maven.execution.MavenExecutionResult; -import org.apache.maven.execution.MavenSession; -import org.apache.maven.execution.ReactorManager; -import org.apache.maven.execution.RuntimeInformation; -import org.apache.maven.execution.SessionContext; +import org.apache.maven.execution.*; import org.apache.maven.extension.BuildExtensionScanner; import org.apache.maven.extension.ExtensionScanningException; import org.apache.maven.lifecycle.LifecycleExecutor; @@ -57,18 +49,14 @@ import org.codehaus.plexus.context.ContextException; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable; import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.dag.CycleDetectedException; import java.io.File; import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.TimeZone; +import java.util.*; /** * @author jason van zyl @@ -487,6 +475,13 @@ public class DefaultMaven { String name = (String) i.next(); + if ( StringUtils.isEmpty( StringUtils.trim( name ) ) ) + { + getLogger().warn( "Empty module detected. Please check you don't have any empty module definitions in your POM." ); + + continue; + } + File moduleFile; if ( usingReleasePom )