scala-cli
scala-cli copied to clipboard
Passing the Java property into Scala CLI should also pass it into BSP
Version(s)
0.2.1
Describe the bug Passing the Java property into Scala CLI should also pass it into BSP.
To Reproduce
First run of Scala CLI should create a BSP setup in which -Dfoo=bar properties are also set as Java properties for the Scala CLI BSP command.
scala-cli -Dfoo=bar run .
so it should create scala-cli.json with the following content:
{
"name": "scala-cli",
"argv": [
"/usr/local/bin/scala-cli",
"-Dfoo=bar",
"bsp",
"--json-options",
"/private/tmp/scala-demo/.scala-build/ide-options-v2.json",
"/private/tmp/scala-demo"
],
"version": "0.2.1",
"bspVersion": "2.1.0-M3",
"languages": [
"scala",
"java"
]
Expected behaviour
It should also work with the setup-ide command.
First run of Scala CLI should
what about the second and subsequent runs?
If we only support the first run, then we will run into bad DX in the following scenario:
- user starts to play with the first version of their script:
scala-cli run ., thescala-cli.jsongets generated - user recognizes, that they want to add a critical JVM property (for example:
-Djavax.net.ssl.trustStore=mycompanycertsin order for scala-cli to be able to fetch some dependencies from their company-internal Nexus repository) - does
scala-cli.jsonstay as it was? Because if it does, then the instance ofscala-cliis unable to fetch the required dependencies because of ajavax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targetexception (caused by the lack of the required certificate from the default cacerts/truststore file). Should the user be forced to search the web for a solution and then to update thescala-cli.jsonfile by hand?