tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andygumbre...@apache.org
Subject [19/24] tomee git commit: clean up for java7 of the ExecRunner
Date Mon, 02 Nov 2015 17:15:13 GMT
clean up for java7 of the ExecRunner


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/796342ac
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/796342ac
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/796342ac

Branch: refs/heads/tomee-7.0.0-M1
Commit: 796342ac6c47cdb8392d3ec157d35b7af4cb3e82
Parents: 1d64880
Author: Romain Manni-Bucau <rmannibu@gmail.com>
Authored: Mon Oct 26 08:29:14 2015 +0100
Committer: Romain Manni-Bucau <rmannibu@gmail.com>
Committed: Mon Oct 26 08:29:14 2015 +0100

----------------------------------------------------------------------
 .../openejb/maven/plugin/runner/ExecRunner.java     | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/796342ac/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/runner/ExecRunner.java
----------------------------------------------------------------------
diff --git a/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/runner/ExecRunner.java
b/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/runner/ExecRunner.java
index 7a628f8..5aec19a 100644
--- a/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/runner/ExecRunner.java
+++ b/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/runner/ExecRunner.java
@@ -20,7 +20,6 @@ import org.apache.openejb.config.RemoteServer;
 import org.apache.openejb.loader.Files;
 import org.apache.openejb.loader.IO;
 import org.apache.openejb.loader.Zips;
-import org.apache.openejb.util.Pipe;
 import org.apache.tomee.util.QuickServerXmlParser;
 
 import java.io.File;
@@ -144,6 +143,7 @@ public class ExecRunner {
             params.addAll(asList(args));
 
             final ProcessBuilder builder = new ProcessBuilder(params.toArray(new String[params.size()]))
+                .inheritIO()
                 .directory(findBase(distribOutput));
 
             final String existingOpts = System.getenv("CATALINA_OPTS");
@@ -152,19 +152,7 @@ public class ExecRunner {
                 builder.environment().put("CATALINA_OPTS", identityOrEmpty(catalinaOpts)
+ " " + identityOrEmpty(existingOpts) + " " + identityOrEmpty(additionalArgs));
             }
 
-            boolean redirectOut = false;
-            try { // java >= 7
-                ProcessBuilder.class.getDeclaredMethod("inheritIO").invoke(builder);
-            } catch (final Throwable th){ // java 6
-                redirectOut = true;
-            }
-
-            final Process process = builder.start();
-            if (redirectOut) {
-                Pipe.pipe(process);
-            }
-
-            process.waitFor();
+            builder.start().waitFor();
         }
 
         System.out.flush();


Mime
View raw message