actuator

Injecting version number with Maven and expose it with Spring Actuator

In my current project, we needed to identify each build with a version number. We decided to inject this number at compile-time, so it would be generated at each Jenkins Build with a unique build-number, allowing us to always be in a “production-ready” state. Setting up the POM You can set a default value in the properties, here I’ve added metadata information “-dev”, that is useful to distinguish different build profiles (local, Jenkins CI, etc…).