title: PropertySourcesPlaceholderConfigurer not registering with Environment in a SpringBoot Project
body: <p>I am moving a working project from using SpringBoot command line arguments to reading properties from a file. Here are the involved portions of the <code>@Configuration</code> class:</p>
  
  <pre><code>@Configuration
  class RemoteCommunication {
  
      @Inject
      StandardServletEnvironment env
  
  
      @Bean
      static PropertySourcesPlaceholderConfigurer placeholderConfigurer () {
          // VERIFIED this is executing...
          PropertySourcesPlaceholderConfigurer target = new PropertySourcesPlaceholderConfigurer()
          // VERIFIED this files exists, is readable, is a valid properties file
          target.setLocation (new FileSystemResource ('/Users/me/Desktop/mess.properties'))
          // A Debugger does NOT show this property source in the inject Environment
          target
      }
  
  
      @Bean  // There are many of these for different services, only one shown here.
      MedicalSorIdService medicalSorIdService () {
          serviceInstantiator (MedicalSorIdService_EpicSoap, 'uri.sor.id.lookup.internal')
      }
  
  
      // HELPER METHODS...
  
  
      private &lt;T&gt; T serviceInstantiator (final Class&lt;T&gt; classToInstantiate, final String propertyKeyPrimary) {
          def value = retrieveSpringPropertyFromConfigurationParameter (propertyKeyPrimary)
          classToInstantiate.newInstance (value)
      }
  
  
      private def retrieveSpringPropertyFromConfigurationParameter (String propertyKeyPrimary) {
          // PROBLEM: the property is not found in the Environment
          def value = env.getProperty (propertyKeyPrimary, '')
          if (value.isEmpty ()) throw new IllegalStateException ('Missing configuration parameter: ' + "\"$propertyKeyPrimary\"")
          value
      }
  </code></pre>
  
  <p>Using <code>@Value</code> to inject the properties <strong>does</strong> work, however I'd rather work with the <code>Environment</code> directly if at all possible. If the settings are not in the <code>Environment</code> then I am not exactly sure where <code>@Value</code> is pulling them from...</p>
  
  <p><code>env.getProperty()</code> continues to work well when I pass in command line arguments specifying the properties though.</p>
  
  <p>Any suggestions are welcome!</p>