Exporting App Properties to a File
You can export the app properties to a JSON file or a
.properties
file. The exported JSON file can be used to override app property values.
When using the exported properties file, the values in the properties file get validated by the app during runtime. If a property value in the file is invalid, you get an error saying so and the app proceeds to use the default value for that property instead.
Exporting the app properties to a JSON file
Exporting the app properties to a JSON file allows you to override the default app property values during app runtime. It is useful if you want to test your app by plugging in different test data with successive test runs of your app. You can set the app properties in the exported file to a different value during each run of the app. The default app property values get overridden with the values that you set in the exported file.
To export the app properties to a JSON file, run the following command from the directory where your app resides:
./<app-binary-name> -export props-jsonThe properties get exported to
<app-binary-name>-props.json
file.
Exporting app properties to a .properties file
You cannot use a
.properties
file format to override the app properties that were externalized using environment variables.
To export the app properties to a
.properties
file, run the following command from the directory where your app resides:
./<app-binary-name> -export props-env
The properties get exported to
<app-binary-name>-env.properties
file. The names of the app properties appear in all uppercase in the exported
env.properties
file. For example, a property named
Message
appears as
MESSAGE
. A hierarchy such as
x.y.z
appears as
X_Y_Z
.