24.2 Accessing command line properties
By default SpringApplication
will convert any command line option arguments (starting with ‘--’, e.g. --server.port=9000
) to a property
and add it to the Spring Environment
. As mentioned above, command line properties always take precedence over other property sources.
If you don’t want command line properties to be added to the Environment
you can disable them using SpringApplication.setAddCommandLineProperties(false)
.