maven-jar-plugin icon indicating copy to clipboard operation
maven-jar-plugin copied to clipboard

[MJAR-310] - fixed toolchain version detection when toolchain paths contain white spaces

Open jansohn opened this issue 1 year ago • 4 comments

Switched to ProcessBuilder for JDK toolchain version detection as it actually correctly handles white spaces in the executable path compared to the plexus-utils dependency.

jansohn avatar May 17 '24 12:05 jansohn

@jansohn - please look at comments in JIRA https://issues.apache.org/jira/browse/MJAR-310 It can be reasonable to fix a bug in plexus-utils

slawekjaranowski avatar May 18 '24 12:05 slawekjaranowski

@jansohn can you try my proposition of fix: #87

slawekjaranowski avatar May 18 '24 12:05 slawekjaranowski

@jansohn - please look at comments in JIRA https://issues.apache.org/jira/browse/MJAR-310 It can be reasonable to fix a bug in plexus-utils

Makes sense but there are already three year old PRs trying to revert the extra use of cmd.exe so I'm not keen on going down that route.

I think it makes more sense to just use ProcessBuilder directly for such a simple task.

jansohn avatar May 18 '24 13:05 jansohn

@jansohn can you try my proposition of fix: #87

I can test it on Tuesday but I doubt it will fix the problem.

jansohn avatar May 18 '24 13:05 jansohn

@jansohn can you try my proposition of fix: #87

I can test it on Tuesday but I doubt it will fix the problem.

I stand corrected and #87 actually does solve the issue with blanks in Windows paths.

Totally unintuitive that it works by setter and not by constructor argument in my opinion. While digging into the code I also saw that it actually dismisses the shell wrapping if it detects a non-Windows OS which explains why this only occurred on Windows systems.

Personally I would not rely on such an overly complex third library for such a simple use case but feel free to merge whatever PR you prefer.

jansohn avatar May 21 '24 07:05 jansohn

Commandline used by constructor try to parse command .... so when we have a space it is wrong parsed ...

@michael-o - next issue with parsing command line 😄

slawekjaranowski avatar May 21 '24 14:05 slawekjaranowski

Commandline used by constructor try to parse command .... so when we have a space it is wrong parsed ...

@michael-o - next issue with parsing command line 😄

It does not surprise me. I have been telling that this is broken for years.

michael-o avatar May 22 '24 07:05 michael-o

@jansohn thanks

slawekjaranowski avatar Jun 01 '24 18:06 slawekjaranowski