mojohaus / appassembler

https://www.mojohaus.org/appassembler/
MIT License
93 stars 49 forks source link

Errors when using Cygwin and `useWildcardClassPath=true` #61

Open jgebal opened 6 years ago

jgebal commented 6 years ago

Shell script generated with useWildcardClassPath=true is not working properly on Git Bash command-line. (MINGW64).

Symptoms:

After some investigation I've found that the issue is related to the wildcard in path and the fact that cygpath conversion is actually not invoked and for some reasons Unix-style CLASSPATH is ok without wildcard, but with wildcard it is not.

Change from:

# OS specific support.  $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" in
  CYGWIN*) cygwin=true ;;
  Darwin*) darwin=true

To:

# OS specific support.  $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" in
  CYGWIN*) cygwin=true ;;
  MINGW*) cygwin=true ;;
  Darwin*) darwin=true

Solves the issue.

Can you incorporate support for git-bash (MINGW64)? It seems more and more popular nowadays.

jgebal commented 6 years ago

To add more context:

$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

After a bit more digging, I've noticed that without cygwin=true no paths except JAVA_HOME are getting converged to Windows format and is the only one that stays in Windows-style format as opposed to all the rest of path variables: example:

CLASSPATH =>"/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/*:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/etc:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/java-api-3.0.4.jar:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/jcommander-1.69.jar:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/HikariCP-2.7.2.jar:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/slf4j-api-1.7.25.jar:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/slf4j-nop-1.7.25.jar:/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib/cli-3.0.4-SNAPSHOT.jar"
JAVA_HOME =>"C:\Program Files\Java\jdk1.8.0_40"
HOME =>"/c/Users/Jacek"
BASEDIR =>"/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli"
REPO =>"/c/Users/Jacek/IdeaProjects/utPLSQL-demo-project/utPLSQL-cli/lib"

Enabling cygwin=true causes all paths to be in the same (Windows) style.

jgebal commented 6 years ago

I get exactly the same error when running script generated with flag: endorsedDir=true