tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: TOMEE-1638 backporting build mojo format support
Date Sun, 18 Oct 2015 09:07:33 GMT
Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x 7ea84538b -> 11b54abf7


TOMEE-1638 backporting build mojo format support


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

Branch: refs/heads/tomee-1.7.x
Commit: 11b54abf73ca2944ada1d052f776a23656a6e6b1
Parents: 7ea8453
Author: Romain Manni-Bucau <rmannibu@gmail.com>
Authored: Sun Oct 18 11:07:25 2015 +0200
Committer: Romain Manni-Bucau <rmannibu@gmail.com>
Committed: Sun Oct 18 11:07:25 2015 +0200

----------------------------------------------------------------------
 .../apache/openejb/maven/plugin/runner/ExecRunner.java | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/11b54abf/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 460ba0b..b586634 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
@@ -65,8 +65,8 @@ public class ExecRunner {
         final File timestampFile = new File(distribOutput, "timestamp.txt");
         final boolean forceDelete = Boolean.getBoolean("tomee.runner.force-delete");
         if (forceDelete
-                || !timestampFile.exists()
-                || Long.parseLong(IO.slurp(timestampFile).replace(System.getProperty("line.separator"),
"")) < Long.parseLong(config.getProperty("timestamp"))) {
+            || !timestampFile.exists()
+            || Long.parseLong(IO.slurp(timestampFile).replace(System.getProperty("line.separator"),
"")) < Long.parseLong(config.getProperty("timestamp"))) {
             if (forceDelete || timestampFile.exists()) {
                 System.out.println("Deleting " + distribOutput.getAbsolutePath());
                 Files.delete(distribOutput);
@@ -97,8 +97,8 @@ public class ExecRunner {
             if (lastSlash > 0) {
                 final String dir = cmd.substring(0, lastSlash);
                 final String script = cmd.substring(lastSlash + 1, cmd.length() - SH_BAT_AUTO.length())
-                        + (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("win")
? ".bat" : ".sh");
-                cmd = dir + '/' + script;
+                    + (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("win")
? ".bat" : ".sh");
+                cmd = dir + File.separator + script;
                 final File scriptFile = new File(distribOutput, cmd);
                 if (!scriptFile.exists()) {
                     throw new IllegalArgumentException("Can't find  " + cmd);
@@ -144,6 +144,11 @@ public class ExecRunner {
             server.start(jvmArgs, args[0], true);
             server.getServer().waitFor();
         } else {
+            // TODO: split cmd correctly to support multiple inlined segments in cmd
+            if (cmd.endsWith(".bat") && !cmd.startsWith("cmd.exe")) {
+                params.add("cmd.exe");
+                params.add("/c");
+            } // else suppose the user knows what he does
             params.add(cmd);
             params.addAll(asList(args));
 


Mime
View raw message