Closed lrytz closed 4 years ago
The current setup is to workaround https://github.com/coursier/coursier/issues/1519. Are you saying that resolved?
Seems so, at least for me, using the scala-runner version of this PR
➜ scala-runners git:(minusJ) ./scala -Dfoo.bar=baz -e 'println(System.getProperty("foo.bar"))'
baz
That's with
➜ scala-runners git:(minusJ) cs --help
Coursier 2.0.0-RC6-11
Cool, looks like this is definitely a net improvement, seeing as it fixes -Dscala.color
too.
$ cs launch scala -Dfoo=bar -- -e 'println(sys.props("foo"))'
Unrecognized argument: -Dfoo=bar
$ cs launch scala -J-Dfoo=bar -- -e 'println(sys.props("foo"))'
Unrecognized argument: -J-Dfoo=bar
$ cs launch scala -Dscala.color -- -e 'println(sys.props.get("scala.color"))'
Unrecognized argument: -Dscala.color
$ cs launch scala -J-Dscala.color -- -e 'println(sys.props.get("scala.color"))'
Unrecognized argument: -J-Dscala.color
$ cs launch scala -D scala.color -- -e 'println(sys.props.get("scala.color"))'
Malformed property argument 'scala.color' (expected name=value)
$
$ cs launch scala -J -Dfoo=bar -- -e 'println(sys.props("foo"))'
bar
$ cs launch scala -J -Dscala.color -- -e 'println(sys.props.get("scala.color"))'
Some()
Also pass properties with
-J -Dfoo=bar
as recommended on https://get-coursier.io/docs/cli-launch.html#java-options instead of-D foo=bar
.