tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Eaves (JIRA)" <>
Subject [jira] [Commented] (TOMEE-1638) tomee:exec on Windows produces invalid due to backslash directory separators
Date Mon, 19 Oct 2015 08:52:05 GMT


David Eaves commented on TOMEE-1638:

This now works when running on Linux, but no longer works when running on Windows.

When using the default command the directory separators are not converted correctly for Windows.
The "command" config property is "apache-tomee/bin/catalina[.sh|.bat]", which ends up producing
the following params for ProcessBuilder (note the forward slash in the third parameter):

  [cmd.exe, /c, apache-tomee/bin\catalina.bat, run]

The attached patch corrects this, however the execution still fails due to catalina.bat being
unable to figure out where CATALINA_HOME is. It looks like it only tries the current directory,
which is .distribution rather than .distribution\apache-tomee. NB, seems to work
presumably due to being able to locate CATALINA_HOME relative to the script.

When running with the command "java" (i.e. jar produced via "mvn tomee:exec -Dtomee-plugin.script=java")
the apache-tomee subdirectory isn't accounted for at all in that branch of the code (if ("java".equals(cmd))
{ ...). This code doesn't seem like it will work under Linux or Windows now that the apache-tomee
subdirectory is present.

I haven't tried testing with TomEE 7, but would expect most of these issues apply to that

> tomee:exec on Windows produces invalid due to backslash directory separators
> --------------------------------------------------------------------------------------
>                 Key: TOMEE-1638
>                 URL:
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Maven Plugin
>    Affects Versions: 1.7.2
>         Environment: Windows
>            Reporter: David Eaves
>            Priority: Minor
>         Attachments:,,
> The tomee:exec target produces an invalid file within the standalone jar when
run under Windows. This prevents the standalone jar from being run under Linux.
> This issue is caused by the use of platform directory separators in the Zip entry names
rather than forward slashes. See section 4.4.17 at
> The offending code is in org.apache.openejb.maven.plugin.util.Zips. I have produced a
fix and tested this stand-alone, but not in the context of the plugin.

This message was sent by Atlassian JIRA

View raw message