Exporting Application Properties to a File

You can export the application properties to a JSON file or a .properties file. The exported JSON file can be used to override application 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 application properties to a JSON file

Exporting the application properties to a JSON file allows you to override the default application 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 application properties in the exported file to a different value during each run of the app. The default application property values get overridden with their values that you set in the exported file.

To export the application properties to a JSON file, run the following command from the directory where your app resides:
./<app-binary-name> -export props-json
The properties get exported to <app-binary-name>-props.json file.

Exporting application properties to a .properties file

You cannot use a .properties file format to override the application properties that were externalized using environment variables. To export the application 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 application properties appear in all uppercase in the exported env.properties file. For example, a property named Message will appear as MESSAGE. A hierarcy such as x.y.z will appear as X_Y_Z.