title: how to rename or map inherited application.yml values in springboot?
body: <p>My project has a dependency say <em><strong>xyz</strong></em> in that dependency there is a property called <em><strong>my.dependency</strong></em> in application.yaml, it's getting inherited in my application. I want to map it to another property called <em><strong>my.test.project</strong></em> in my application. Instead of writing a new property name, I can reuse the same dependency but due to name constraints, I want to rename and wrap the dependency property with another name in my application. I can play around with setters and make it work but someone kindly suggests the best approach to this.</p>
  <p>DependencyConfig:</p>
  <pre><code>@ConfigurationProperties(prefix = &quot;my.dependency&quot;)
  @Setter
  @Getter
  public class DependencyConfig {
      public int dependencyValue;
      ...
      ...
  }
  </code></pre>
  <p>ActualProjectConfig:</p>
  <pre><code>@ConfigurationProperties(prefix = &quot;my.test.project&quot;)
  @Setter
  @Getter
  public class ProjectConfig {
  
      @Autowired
      DependencyConfig dependencyConfig;
  
      public int projectValue;
      ...
      ...
      
     public void setProjectValue(int value) {
         this.projectValue = value;
         dependencyConfig.setDependencyValue(value);
     }
  
     public int getProjectValue() {
         return dependencyConfig.getDependencyValue();
     }
  }
  </code></pre>