Ladies & Gents, I prototyped just a small app that could help you print out some basic environment related information by exposing a few Rest controller endpoints.
Running the app
The easiest way is to run the app using Spring boot maven plugin
Here, we specify some Java properties that will be used by the application:
- foo, bar, baz custom properties
- server.port – which is the way to instruct Spring Boot which port to use
- we also specify to start with remote debug capabilities (if we’d like to do some remote debugging with our IDE)
Rest controller exposing various system / spring properties
Highlighted are lines used to get insights from running application environment. We are injecting Environment implementation which gives us access to environment properties, and application profiles.
In the application.properties (main Spring Boot configuration file) we define two custom Spring environment properties: properties.key1 and properties.key2.
View original post 53 more words