title: Does Spring Boot Actuator have a Java API?
body: <p>We customize the Spring Boot Actuator Info endpoint to include the application version number generated during our Jenkins build.  We're using gradle to do this:</p>
  
  <pre><code>if (project.hasProperty('BUILD_NUMBER')) {
      version = "${BUILD_NUMBER}"
  } else {
      version = "0.0.1-SNAPSHOT"
  }
  </code></pre>
  
  <p>That works great for adding the version to the /info endpoint, but I'd like to access it when the application starts and print it to the application log.</p>
  
  <p>I'm hoping the values are exposed in some property value (similar to <code>spring.profiles.active</code>) or through a Java API.  That way, I could do something like this:</p>
  
  <pre><code>    public class MyApplication{
  
      public static void main(String[] args) throws Exception {
          SpringApplication.run(MyApplication.class, args);
  
          ConfigurableEnvironment environment = applicationContext.getEnvironment();
  
  System.out.println(environment.getProperty("spring.fancy.path.to.info.version"));
      }
  }
  </code></pre>
  
  <p>Looking through the docs, I'm not finding a way to access these values easily in code.  Has anyone else had luck with this?</p>