title: I can't get value of a property in spring-boot application
body: <p>I am coding in spring-boot. I tried to get the value of properties.properties in other packages without success. For example in the classe ClassUtils.java, the value of testValue is always null</p>
  
  <p>This is my project </p>
  
  <p><a href="https://i.stack.imgur.com/M67mc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M67mc.png" alt="enter image description here"></a></p>
  
  <p>This is my code:</p>
  
  <pre><code>package com.plugins.controller;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.beans.factory.annotation.Value;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.ResponseBody;
  import org.springframework.web.bind.annotation.RestController;
  
  import com.plugins.domain.ClassUtils;
  
  @RestController
  public class SearchContactController {
      @Value("${environnement.test}")
      String testValue;
  
      @Value("${environnement.url}")
      String urlValue;
  
      @RequestMapping(value = "/test")
      public String pingRequest() {
          System.out.println("value ===&gt; " + testValue + " /// " + urlValue);
  
          return "test !" + ClassUtils.getTestValue(); 
      }
  
  }
  </code></pre>
  
  <p>This is my second class, where I can't get the value of testValue variable:</p>
  
  <pre><code>package com.plugins.domain;
  
  import org.springframework.beans.factory.annotation.Value;
  import org.springframework.stereotype.Component;
  
  @Component
  public class ClassUtils {
  
      @Value("${environnement.test}")
      static String testValue;
  
  
      public static String getTestValue(){
          return "The return "+testValue;    
      }
  }
  </code></pre>
  
  <p>This is my springApp.java</p>
  
  <pre><code>package com.plugins;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class SpringBootVideApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(SpringBootVideApplication.class, args);
      }
  }
  </code></pre>