title: Spring properties configuration using @PropertySource with external JSON file
body: <p>I am using spring boot with an access to keycloak. I need to leave the keycloak configuration in the keycloak.json file I would like to get teh values from the json using the PropertySource annotation...</p>
  
  <p>My application.yml</p>
  
  <pre><code>keycloak:
     configurationFile: "classpath:keycloak.json"
  </code></pre>
  
  <p>My keycloak.json</p>
  
  <pre><code>{
    "realm": "MyRealm",
    "auth-server-url": "https://keycloakURL",
  ....
  }
  </code></pre>
  
  <p>My class</p>
  
  <pre><code>@Controller
  @Configuration
  @PropertySource("classpath:keycloak.json")
  public class MyClass{
  
  @Autowired
  private Environment env;
  
  @RequestMapping(value = "/mycontroller", method = RequestMethod.GET)
      public String method(Model model) {
      env.getProperty("auth-server-url")
  }
  </code></pre>
  
  <p>The problem is that i am getting null for this environment variable</p>