maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1144697 - in /maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype: mojos/CreateProjectFromArchetypeMojo.java ui/DefaultArchetypeSelector.java
Date Sat, 09 Jul 2011 16:36:08 GMT
Author: olamy
Date: Sat Jul  9 16:36:08 2011
New Revision: 1144697

URL: http://svn.apache.org/viewvc?rev=1144697&view=rev
Log:
[ARCHETYPE-371] display a message when filter doesn't find any archetype to use

Modified:
    maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo.java
    maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java

Modified: maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo.java?rev=1144697&r1=1144696&r2=1144697&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo.java
(original)
+++ maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo.java
Sat Jul  9 16:36:08 2011
@@ -199,6 +199,12 @@ public class CreateProjectFromArchetypeM
 
             selector.selectArchetype( request, interactiveMode, archetypeCatalog );
 
+            if ( org.apache.commons.lang.StringUtils.isBlank( request.getArchetypeArtifactId())
)
+            {
+                // no archetype found : stopping
+                return;
+            }
+
             configurator.configureArchetype( request, interactiveMode, executionProperties
);
 
             ArchetypeGenerationResult generationResult = archetype.generateProjectFromArchetype(
request );

Modified: maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java?rev=1144697&r1=1144696&r2=1144697&view=diff
==============================================================================
--- maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java
(original)
+++ maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java
Sat Jul  9 16:36:08 2011
@@ -31,8 +31,6 @@ import org.codehaus.plexus.components.in
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -79,6 +77,11 @@ public class DefaultArchetypeSelector
         {
             // applying some filtering depending on filter parameter
             archetypes = ArchetypeSelectorUtils.getFilteredArchetypesByCatalog( archetypes,
request.getFilter() );
+            if ( archetypes.isEmpty() )
+            {
+                getLogger().info( "your filter doesn't find any archetype, so try again with
an other value" );
+                return;
+            }
         }
 
         if ( definition.isDefined() && StringUtils.isEmpty( request.getArchetypeRepository()
) )



Mime
View raw message