openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1792583 - in /openwebbeans/meecrowave/trunk: meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/ meecrowave-core/src/main/java/org/apache/meecrowave/ meecrowave-doc/src/main/jbake/content/meecrowave-maven/ meecrowave-grad...
Date Tue, 25 Apr 2017 07:58:08 GMT
Author: rmannibucau
Date: Tue Apr 25 07:58:08 2017
New Revision: 1792583

URL: http://svn.apache.org/viewvc?rev=1792583&view=rev
Log:
MEECROWAVE-27 better wiring of default options, some words in the doc on bundle task

Modified:
    openwebbeans/meecrowave/trunk/meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveConfiguration.java
    openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
    openwebbeans/meecrowave/trunk/meecrowave-doc/src/main/jbake/content/meecrowave-maven/index.adoc
    openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveExtension.java
    openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveTask.java
    openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveBundleMojo.java
    openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java
    openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/resources/bin/meecrowave.sh

Modified: openwebbeans/meecrowave/trunk/meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveConfiguration.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveConfiguration.java?rev=1792583&r1=1792582&r2=1792583&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveConfiguration.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveConfiguration.java
Tue Apr 25 07:58:08 2017
@@ -103,6 +103,7 @@ public class MeecrowaveConfiguration imp
     private boolean injectServletContainerInitializer = true;
     private String tomcatAccessLogPattern;
     private boolean jaxrsAutoActivateBeanValidation = true;
+    private String meecrowaveProperties = "meecrowave.properties";
 
     // configurable cause when set to Local arquillian bypass some protocol configuration
cause of container default
     private String arquillianProtocol = "Servlet 3.1";
@@ -757,4 +758,12 @@ public class MeecrowaveConfiguration imp
     public void setJaxrsAutoActivateBeanValidation(final boolean jaxrsAutoActivateBeanValidation)
{
         this.jaxrsAutoActivateBeanValidation = jaxrsAutoActivateBeanValidation;
     }
+
+    public String getMeecrowaveProperties() {
+        return meecrowaveProperties;
+    }
+
+    public void setMeecrowaveProperties(final String meecrowaveProperties) {
+        this.meecrowaveProperties = meecrowaveProperties;
+    }
 }

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java?rev=1792583&r1=1792582&r2=1792583&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
Tue Apr 25 07:58:08 2017
@@ -353,6 +353,10 @@ public class Meecrowave implements AutoC
     }
 
     public Meecrowave start() {
+        if (configuration.getMeecrowaveProperties() != null && !"meecrowave.properties".equals(configuration.getMeecrowaveProperties()))
{
+            configuration.loadFrom(configuration.getMeecrowaveProperties());
+        }
+
         setupJmx(configuration.isTomcatNoJmx());
 
         clearCatalinaSystemProperties = System.getProperty("catalina.base") == null &&
System.getProperty("catalina.home") == null;
@@ -808,7 +812,7 @@ public class Meecrowave implements AutoC
             return dirFile.getAbsolutePath();
         }
 
-        file = new File(Stream.of("target", "build", ".")
+        file = new File(Stream.of(new File(System.getProperty("meecrowave.base", "."), "temp").getAbsolutePath(),
"target", "build", ".")
                 .map(File::new)
                 .filter(File::isDirectory)
                 .findFirst().get(), "meecrowave-" + System.nanoTime());
@@ -1030,6 +1034,11 @@ public class Meecrowave implements AutoC
                 description = "Activates and configure the access log valve. Value example:
'%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"'")
         private String tomcatAccessLogPattern;
 
+        @CliOption(
+                name = "meecrowave-properties",
+                description = "Loads a meecrowave properties, defaults to meecrowave.properties.")
+        private String meecrowaveProperties = "meecrowave.properties";
+
         private final Map<Class<?>, Object> extensions = new HashMap<>();
         private final Collection<Consumer<Tomcat>> instanceCustomizers = new
ArrayList<>();
 
@@ -1037,7 +1046,7 @@ public class Meecrowave implements AutoC
             extensions.put(ValueTransformers.class, new ValueTransformers());
             StreamSupport.stream(ServiceLoader.load(Meecrowave.ConfigurationCustomizer.class).spliterator(),
false)
                     .forEach(c -> c.accept(this));
-            loadFrom("meecrowave.properties");
+            loadFrom(meecrowaveProperties);
         }
 
         public <T> T getExtension(final Class<T> extension) {
@@ -1872,6 +1881,14 @@ public class Meecrowave implements AutoC
         public void setInjectServletContainerInitializer(final boolean injectServletContainerInitializer)
{
             this.injectServletContainerInitializer = injectServletContainerInitializer;
         }
+
+        public String getMeecrowaveProperties() {
+            return meecrowaveProperties;
+        }
+
+        public void setMeecrowaveProperties(final String meecrowaveProperties) {
+            this.meecrowaveProperties = meecrowaveProperties;
+        }
     }
 
     public static class ValueTransformers implements Function<String, String> {

Modified: openwebbeans/meecrowave/trunk/meecrowave-doc/src/main/jbake/content/meecrowave-maven/index.adoc
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-doc/src/main/jbake/content/meecrowave-maven/index.adoc?rev=1792583&r1=1792582&r2=1792583&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-doc/src/main/jbake/content/meecrowave-maven/index.adoc
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-doc/src/main/jbake/content/meecrowave-maven/index.adoc
Tue Apr 25 07:58:08 2017
@@ -24,6 +24,31 @@ Here are the available options (see core
 
 include::../../../../../target/generated-doc/MavenConfiguration.adoc[]
 
+== Bundling
+
+[source]
+----
+mvn meecrowave:bundle
+----
+
+This maven goal will create a zip/tar.gz (configurable) ready to launch your application.
+
+The layout if the following one:
+
+[source]
+----
+
+----
+
+conf folder supports out of the box these files (but you can add your own if needed):
+
+- log4j2.xml
+- server.xml
+- meecrowave.properties
+
+You can acess the root folder of the distribution reading the system property `meecrowave.base`.
+
+`meecrowave.properties` supports all configuration options of the cli (just remove the `--`):
http://openwebbeans.apache.org/meecrowave/meecrowave-core/cli.html.
 
 == Shading
 

Modified: openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveExtension.java?rev=1792583&r1=1792582&r2=1792583&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveExtension.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveExtension.java
Tue Apr 25 07:58:08 2017
@@ -93,6 +93,15 @@ public class MeecrowaveExtension {
     private boolean injectServletContainerInitializer = true;
     private String tomcatAccessLogPattern;
     private boolean jaxrsAutoActivateBeanValidation = true;
+    private String meecrowaveProperties = "meecrowave.properties";
+
+    public String getMeecrowaveProperties() {
+        return meecrowaveProperties;
+    }
+
+    public void setMeecrowaveProperties(final String meecrowaveProperties) {
+        this.meecrowaveProperties = meecrowaveProperties;
+    }
 
     public boolean isJava9SkipWorkarounds() {
         return java9SkipWorkarounds;

Modified: openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveTask.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveTask.java?rev=1792583&r1=1792582&r2=1792583&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveTask.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveTask.java
Tue Apr 25 07:58:08 2017
@@ -332,6 +332,10 @@ public class MeecrowaveTask extends Defa
     @Optional
     private boolean jaxrsAutoActivateBeanValidation = true;
 
+    @Input
+    @Optional
+    private String meecrowaveProperties = "meecrowave.properties";
+
     @TaskAction
     public void bake() {
         fixConfig();
@@ -1148,4 +1152,12 @@ public class MeecrowaveTask extends Defa
     public void setJaxrsAutoActivateBeanValidation(final boolean jaxrsAutoActivateBeanValidation)
{
         this.jaxrsAutoActivateBeanValidation = jaxrsAutoActivateBeanValidation;
     }
+
+    public String getMeecrowaveProperties() {
+        return meecrowaveProperties;
+    }
+
+    public void setMeecrowaveProperties(final String meecrowaveProperties) {
+        this.meecrowaveProperties = meecrowaveProperties;
+    }
 }

Modified: openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveBundleMojo.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveBundleMojo.java?rev=1792583&r1=1792582&r2=1792583&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveBundleMojo.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveBundleMojo.java
Tue Apr 25 07:58:08 2017
@@ -154,6 +154,9 @@ public class MeecrowaveBundleMojo extend
                 "    </Root>\n" +
                 "  </Loggers>\n" +
                 "</Configuration>\n\n");
+        write(new File(distroFolder, "conf/meecrowave.properties"), "# This file contains
the meecrowave default configuration\n" +
+                "# More on http://openwebbeans.apache.org/meecrowave/meecrowave-core/cli.html\n\n"
+
+                "tomcat-access-log-pattern = %h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"");
         write(new File(distroFolder, "logs/you_can_safely_delete.txt"), DELETE_TEXT);
         project.getArtifacts().stream()
                 .filter(this::isIncluded)

Modified: openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java?rev=1792583&r1=1792582&r2=1792583&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java
Tue Apr 25 07:58:08 2017
@@ -278,6 +278,9 @@ public class MeecrowaveRunMojo extends A
     @Parameter
     private String jsContextCustomizer;
 
+    @Parameter(property = "meecrowave.meecrowave-properties", defaultValue = "meecrowave.properties")
+    private String meecrowaveProperties;
+
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
         if (skip) {

Modified: openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/resources/bin/meecrowave.sh
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/resources/bin/meecrowave.sh?rev=1792583&r1=1792582&r2=1792583&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/resources/bin/meecrowave.sh
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/resources/bin/meecrowave.sh
Tue Apr 25 07:58:08 2017
@@ -285,6 +285,18 @@ if [ -f "$MEECROWAVE_BASE"/conf/log4j2.x
   MEECROWAVE_OPTS="$MEECROWAVE_OPTS -Dlog4j.configurationFile="$MEECROWAVE_BASE"/conf/log4j2.xml"
 fi
 
+if [ -f "$MEECROWAVE_BASE"/conf/meecrowave.properties ]; then
+  MEECROWAVE_ARGS="$MEECROWAVE_ARGS --meecrowave-properties="$MEECROWAVE_BASE"/conf/meecrowave.properties"
+fi
+if [ -f "$MEECROWAVE_BASE"/conf/server.xml ]; then
+  MEECROWAVE_ARGS="$MEECROWAVE_ARGS --server-xml="$MEECROWAVE_BASE"/conf/server.xml"
+fi
+
+if [ -z "$MEECROWAVE_TEMP" ]; then
+  mkdir -p "$MEECROWAVE_BASE"/temp
+  MEECROWAVE_ARGS="--tmp-dir="$MEECROWAVE_BASE"/temp"
+fi
+
 if [ "$1" = "run" ]; then
 
   shift
@@ -294,7 +306,7 @@ if [ "$1" = "run" ]; then
     -Dmeecrowave.home="\"$MEECROWAVE_HOME\"" \
     -Dmeecrowave.home="\"$MEECROWAVE_HOME\"" \
     -Djava.io.tmpdir="\"$MEECROWAVE_TMPDIR\"" \
-    ${main} "$@" start
+    ${main} "$MEECROWAVE_ARGS" "$@"
 
 elif [ "$1" = "start" ] ; then
 
@@ -345,7 +357,7 @@ elif [ "$1" = "start" ] ; then
     -Dmeecrowave.base="\"$MEECROWAVE_BASE\"" \
     -Dmeecrowave.home="\"$MEECROWAVE_HOME\"" \
     -Djava.io.tmpdir="\"$MEECROWAVE_TMPDIR\"" \
-    ${main} "$@" start \
+    ${main} "$MEECROWAVE_ARGS" "$@" \
     >> "$MEECROWAVE_OUT" 2>&1 "&"
 
   if [ ! -z "$MEECROWAVE_PID" ]; then



Mime
View raw message