'How to know which environmental variables that are used in spring?

Lets say I have a large multi module java spring project in IntelliJ and I would like to see which database it run towards. How would I do this easily?

More generally it would be nice with an intellij plugin or feature that could show all the environmental variables that are used when for example running a test. I would like to be able to see an overview about which beans are being used, which environmental variables and which settings in various application.* files are being used for this particular execution. Is there such a feature or plugin in IntelliJ or any other way to do it?



Solution 1:[1]

There is many way to do this, but I think the simplest is by adding Spring Actuator to your project. You'll be able to show all created beans and environments variables via exposed endpoints (/beans, /env,..).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mickaël B.