geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r522621 - /geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
Date Mon, 26 Mar 2007 20:47:09 GMT
Author: jdillon
Date: Mon Mar 26 13:47:07 2007
New Revision: 522621

URL: http://svn.apache.org/viewvc?view=rev&rev=522621
Log:
Add propagateGeronimoProperties to allow org.apache.geronimo.* and geronimo.* properties to
optionally propagate from maven to the forked server

Modified:
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java

Modified: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java?view=diff&rev=522621&r1=522620&r2=522621
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
(original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
Mon Mar 26 13:47:07 2007
@@ -100,6 +100,14 @@
     private int verifyTimeout = -1;
 
     /**
+     * Enable propagation of <tt>org.apache.geronimo.*</tt> and <tt>geronimo.*</tt>
+     * properties from Maven to the forked server process.
+     *
+     * @parameter expression="${propagateGeronimoProperties}" default-value="true"
+     */
+    private boolean propagateGeronimoProperties;
+
+    /**
      * An array of option sets which can be enabled by setting optionSetId.
      *
      * @parameter
@@ -146,6 +154,24 @@
         File javaAgentJar = new File(geronimoHome, "bin/jpa.jar");
         if (javaAgentJar.exists()) {
             java.createJvmarg().setValue("-javaagent:" + javaAgentJar.getCanonicalPath());
+        }
+        
+        // Propagate some properties from Maven to the server if enabled
+        if (propagateGeronimoProperties) {
+            Properties props = System.getProperties();
+            Iterator iter = props.keySet().iterator();
+            while (iter.hasNext()) {
+                String name = (String)iter.next();
+                String value = System.getProperty(name);
+                
+                if (name.equals("geronimo.bootstrap.logging.enabled")) {
+                    // Skip this property, never propagate it
+                }
+                else if (name.startsWith("org.apache.geronimo") || name.startsWith("geronimo"))
{
+                    log.debug("Propagating: " + name + "=" + value);
+                    setSystemProperty(java, name, value);
+                }
+            }
         }
         
         // Apply option sets



Mime
View raw message