You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2008/02/15 04:31:57 UTC

svn commit: r627938 - /geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/AssembleServerCommand.groovy

Author: gawor
Date: Thu Feb 14 19:31:55 2008
New Revision: 627938

URL: http://svn.apache.org/viewvc?rev=627938&view=rev
Log:
prompt for server artifact name if not specified and default server version to 1.0 (GERONIMO-3854)

Modified:
    geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/AssembleServerCommand.groovy

Modified: geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/AssembleServerCommand.groovy
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/AssembleServerCommand.groovy?rev=627938&r1=627937&r2=627938&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/AssembleServerCommand.groovy (original)
+++ geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/AssembleServerCommand.groovy Thu Feb 14 19:31:55 2008
@@ -49,7 +49,7 @@
     String artifact
 
     @Option (name = '-v', aliases = ['--version'], description = 'server version')
-    String version
+    String version = "1.0"
 
     @Option (name = '-f', aliases = ['--format'], description = 'zip or tar.gz')
     String format = "tar.gz"
@@ -62,10 +62,16 @@
 
         def connection = variables.get("ServerConnection")
         if (!connection) {
-            //def connectCommand = new ConnectCommand()
-            //connectCommand.init(context)
             connection = super.doExecute()
         }
+              
+        if (!artifact) {
+            artifact = prompter.readLine("Server artifact name: ")
+            if (!artifact) {
+                throw new IllegalArgumentException("Server artifact name is required")
+            }
+        }
+        
         def command = new CommandListConfigurations()
         def consoleReader = new ConsoleReader(io.inputStream, io.out)
         def plugins = variables.get("LocalPlugins")
@@ -73,6 +79,7 @@
             plugins = command.getLocalPluginCategories(connection.getDeploymentManager(), consoleReader)
             variables.parent.set("LocalPlugins", plugins)
         }
+
         if (pluginArtifacts) {
             command.assembleServer(connection.getDeploymentManager(), pluginArtifacts, plugins, 'repository', relativeServerPath, consoleReader)
             connection.getDeploymentManager().archive(relativeServerPath, "var/temp", new Artifact(group, artifact, (String)version, format));