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
Unlike all other Maven properties, spring-boot.run.arguments on the command line takes precedence over the pom #20024
Comments
A value provided by
This isn't so much an exception as it is an order of precedence. The documentation states that I've marked this for team attention so we can discuss the proper order of precedence between POM configuration and |
For consistency with configuration precedence in other area of Spring Boot, I think that system properties provided on the command line should take precedence over something that's hardcoded in the pom.xml file. |
Maven documents the fact that Mojo
|
Just to make sure I've understood, that's the opposite of what would align with Boot's configuration precedence in other areas? |
Yes, exactly the opposite. |
We're going to align with Maven's defaults. |
Re-opening so that we can investigate the test failures on Windows: https://ge.spring.io/s/m62r4fmeh6y6k/tests/failed. |
2.2.x is unaffected by the test failures. |
Description: the
spring-boot.run.jvmArguments
does not take precedence over the< systemPropertyVariables>
map when there is a<jvmArguments>
section defined for thespring-boot-maven-plugin
.Documented behavior:
According to the https://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/run-system-properties.html when the
spring-boot.run.jvmArguments
parameter is provided for thespring-boot:run
command the parameter takes precedence and overwrites the system properties defined within the<systemPropertyVariables>
XML configuration. I would expect that the presence of thejvmArguments
section does not influence the documented behavior.Steps to reproduce:
There is a sample application which demonstrates non-documented (faulty?) behavior located at https://github.com/rawfg/maven-jvmargs.
The sample application prints the system properties starting with the
xyz
and by default there are two system properties configured: one comes from the<jvmArguments>
section and the other one comes from the< systemPropertyVariables>
section.When the application is run from the command line via the command:
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dxyz.MavenSystemProperty='cmd-system-property'"
the output is (system properties configured in the pom.xml):
<jvmArguments>
section is commented out the application behaves as it was documented, so running the command:mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dxyz.MavenSystemProperty='cmd-system-property'"
results in the output:
2.2.4
but I've downgraded to the2.1.7
version and I observed the same outcome.Expected behavior:
-Dspring-boot.run.jvmArguments
always works as documented (step 3) orThe text was updated successfully, but these errors were encountered: