geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r453384 - /geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
Date Thu, 05 Oct 2006 21:17:09 GMT
Author: jdillon
Date: Thu Oct  5 14:17:08 2006
New Revision: 453384

URL: http://svn.apache.org/viewvc?view=rev&rev=453384
Log:
Add org.apache.geronimo.base.dir, java.io.tmpdir, java.endorsed.dirs and java.ext.dirs properties
to the child vm

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=453384&r1=453383&r2=453384
==============================================================================
--- 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
Thu Oct  5 14:17:08 2006
@@ -26,6 +26,7 @@
 import org.apache.maven.plugin.MojoExecutionException;
 
 import org.apache.tools.ant.taskdefs.Java;
+import org.apache.tools.ant.types.Environment;
 
 import org.apache.geronimo.genesis.ObjectHolder;
 import org.apache.geronimo.mavenplugins.geronimo.ServerProxy;
@@ -113,6 +114,13 @@
 
     private Timer timer = new Timer(true);
 
+    private String appendSystemPath(final String name, final File file) {
+        assert name != null;
+        assert file != null;
+
+        return System.getProperty(name) + File.pathSeparator + file.getPath();
+    }
+
     protected void doExecute() throws Exception {
         installAssembly();
 
@@ -130,10 +138,6 @@
             java.setTimeout(new Long(timeout * 1000));
         }
 
-        //
-        // TODO: Capture output/error to files
-        //
-
         if (maximumMemory != null) {
             java.setMaxmemory(maximumMemory);
         }
@@ -153,6 +157,30 @@
             }
         }
 
+        // Set the properties which we pass to the JVM from the startup script
+
+        Environment.Variable var;
+
+        var = new Environment.Variable();
+        var.setKey("org.apache.geronimo.base.dir");
+        var.setFile(geronimoHome);
+        java.addSysproperty(var);
+
+        var = new Environment.Variable();
+        var.setKey("java.io.tmpdir");
+        var.setFile(new File(geronimoHome, "var/temp"));
+        java.addSysproperty(var);
+
+        var = new Environment.Variable();
+        var.setKey("java.endorsed.dirs");
+        var.setValue(appendSystemPath("java.endorsed.dirs", new File(geronimoHome, "lib/endorsed")));
+        java.addSysproperty(var);
+
+        var = new Environment.Variable();
+        var.setKey("java.ext.dirs");
+        var.setValue(appendSystemPath("java.ext.dirs", new File(geronimoHome, "lib/ext")));
+        java.addSysproperty(var);
+        
         if (quiet) {
             java.createArg().setValue("--quiet");
         }
@@ -181,7 +209,11 @@
                 java.createArg().setValue(startModules[i]);
             }
         }
-        
+
+        //
+        // TODO: Check if this really does capture STDERR or not!
+        //
+
         if (logOutput) {
             File file = getLogFile();
             FileUtils.forceMkdir(file.getParentFile());



Mime
View raw message