TOMEE-1638 fixing subdirectory in java script mode
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/d68c149c Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/d68c149c Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/d68c149c Branch: refs/heads/tomee-7.0.0-M1 Commit: d68c149c8881be5129816733a4cb8766cec49737 Parents: f68661c Author: Romain Manni-Bucau <rmann...@gmail.com> Authored: Mon Oct 19 11:26:17 2015 +0200 Committer: Romain Manni-Bucau <rmann...@gmail.com> Committed: Mon Oct 19 11:26:17 2015 +0200 ---------------------------------------------------------------------- .../openejb/maven/plugin/runner/ExecRunner.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/d68c149c/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 8cb5eff..44daac3 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 @@ -77,8 +77,21 @@ public class ExecRunner { } final File[] extracted = distribOutput.listFiles(); - if (extracted != null && extracted.length == 1) { - distribOutput = extracted[0]; + if (extracted != null) { + File newRoot = null; + for (final File e : extracted) { + if (e.isDirectory()) { + if (newRoot == null) { + newRoot = e; + } else { + newRoot = null; + break; + } + } + } + if (newRoot != null) { + distribOutput = newRoot; + } } final File[] scripts = new File(distribOutput, "bin").listFiles(); if (scripts != null) { // dont use filefilter to avoid dependency issue