Uberjar is unhappy with spaces in its absolute path #21

Open
arbscht opened this Issue May 2, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@arbscht
Collaborator

arbscht commented May 2, 2014

When an Optimus+Ring uberjar is run using java -jar foo-standalone.jar, it can fail to start if the jar is under a directory path that includes spaces in the name.

The jar-file-last-modified function in assets/creation.clj assumes that a URL's getPath is a file path; in fact, it returns a URL-encoded file path.

So given "/a/directory/with/a space/foo-standalone.jar", the ZipFile constructor attempts to open "/a/directory/with/a%20space/foo-standalone.jar" and fails.

(This function can be patched to decode using java.net.URLDecoder, but with a caveat that plus signs should be handled specially by percent-encoding as %2b and then decoding again... because Java.)

I'm opening this as an issue and not a PR because xsc's PR #20 appears to avoid this bug by loading directly from a URL with io/resource. Consider this a vote in favour, but I can submit a PR if #20 doesn't get merged.

@magnars

This comment has been minimized.

Show comment Hide comment
@magnars

magnars May 2, 2014

Owner

Sounds like another good reason to get #20 merged. Here's hoping it doesn't break merged folders from different sources on the class path.

Owner

magnars commented May 2, 2014

Sounds like another good reason to get #20 merged. Here's hoping it doesn't break merged folders from different sources on the class path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment