openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1779678 - /openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java
Date Fri, 20 Jan 2017 21:09:23 GMT
Author: rmannibucau
Date: Fri Jan 20 21:09:23 2017
New Revision: 1779678

URL: http://svn.apache.org/viewvc?rev=1779678&view=rev
Log:
MEECROWAVE-8 adding docbase option to the cli

Modified:
    openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java?rev=1779678&r1=1779677&r2=1779678&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java
Fri Jan 20 21:09:23 2017
@@ -56,6 +56,7 @@ public class Cli {
         options.addOption(null, "help", false, "Show help");
         options.addOption(null, "context", true, "The context to use to deploy the webapp");
         options.addOption(null, "webapp", true, "Location of the webapp, if not set the classpath
will be deployed");
+        options.addOption(null, "docbase", true, "Location of the docbase for a classpath
deployment");
         final List<Field> fields = Stream.of(Meecrowave.Builder.class.getDeclaredFields())
                 .filter(f -> f.isAnnotationPresent(CliOption.class))
                 .collect(toList());
@@ -92,10 +93,10 @@ public class Cli {
             final String ctx = line.getOptionValue("context", "");
             final String fixedCtx = !ctx.isEmpty() && !ctx.startsWith("/") ? '/'
+ ctx : ctx;
             final String war = line.getOptionValue("webapp");
+            meecrowave.start();
             if (war == null) {
-                meecrowave.bake(fixedCtx);
+                meecrowave.deployClasspath(new Meecrowave.DeploymentMeta(ctx, ofNullable(line.getOptionValue("docbase")).map(File::new).orElse(null),
null));
             } else {
-                meecrowave.start();
                 meecrowave.deployWebapp(fixedCtx, new File(war));
             }
             meecrowave.getTomcat().getServer().await();



Mime
View raw message