sbt / sbt-native-packager

sbt Native Packager
https://sbt-native-packager.readthedocs.io/en/stable/
BSD 2-Clause "Simplified" License
1.59k stars 438 forks source link

JavaServerAppPackaging sometimes ignores javaOptions. #1607

Open nsutcliffe opened 2 months ago

nsutcliffe commented 2 months ago

Expected behaviour

When using the JavaServerAppPackaging plugin in SBT, I expect it to respect javaOptions specified in SBT. Specifically, when using the plugin as follows:

ThisBuild / javaOptions += "-Dsome-property=true"

Project("some-project", file("some-project").enablePlugins(JavaServerAppPackaging)

I expect, when running the SBT shell command show javaOptions, for javaOptions to be List("-Dsome-property=true").

Actual behaviour

When using the plugin as follows:

ThisBuild / javaOptions += "-Dsome-property=true"

Project("some-project", file("some-project").enablePlugins(JavaServerAppPackaging)

and then running this command from SBT Shell:

show javaOptions

It shows javaOptions as an empty list, that isList().

If, however, I do the following:

ThisBuild / javaOptions += "-Dsome-property=true"

Project("some-project", file("some-project").enablePlugins(JavaServerAppPackaging).settings(javaOptions ++= Seq())

Then javaOptions will be List("-Dsome-property=true")

Information

Please find this bug reproduced in this repository.