Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/launch script accept java options #118

Merged

Conversation

morgen-peschke
Copy link
Contributor

@morgen-peschke morgen-peschke commented Oct 7, 2017

Based off the general idea from #106, with tweaks so the -D* arguments aren't passed on to the jar

@xerial xerial merged commit 63f526c into xerial:master Oct 8, 2017
@xerial
Copy link
Owner

xerial commented Oct 8, 2017

Thanks for the enhancement!

@morgen-peschke
Copy link
Contributor Author

@xerial My pleasure. Do you have a date planned for the next release to hit maven?

@alexarchambault
Copy link
Contributor

@morgen-peschke Does this mean that one cannot anymore pass options that start with -D to programs launched via sbt-pack?

@morgen-peschke
Copy link
Contributor Author

Thanks for noticing that, @alexarchambault, I'd missed that implication because I avoid using -D as arguments to programs which run on the JVM to avoid confusion.

How important of a use case is this? If it's a real consideration, as opposed to hypothetical (it's still a valid point, though), escaping them should be fairly straightforward.

Two straightforward ways of working around this could be:

  • Tweaking the blob slightly and putting a notice in the readme that -D... would be understood as an argument for the JVM, but -D ... would be passed to the program.
  • Modifying the blob to check for -D-D instead and stripping off the extra -D before passing it to the JVM

@morgen-peschke morgen-peschke deleted the feature/launch-script-accept-java-options branch October 18, 2017 17:01
@alexarchambault
Copy link
Contributor

(Oops, sorry for the late answer :/ )

Couldn't this feature be put behind an sbt option? Like a packAutoJavaOptions? If true, then the arguments starting with -D would be passed as java options. If false, they wouldn't (sbt-pack behavior before that PR). I'm using sbt-pack to run some applications where I think I'm using basically all the letters of the alphabet as options ;), so I would disable it here.

But when it's enabled, other forms of Java options could be handled too then (like -Xmx, -Xms, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants