title: Duplicate `@ConfigurationProperties` in two different profile
body: <p>Why can't I define two bean with the same <code>configurationProperties</code> prefix?  Code below throws the following error:</p>
  <pre><code>Duplicate `@ConfigurationProperties` definition for prefix 'config'
  </code></pre>
  <p>I know it is the same but for two different profile. Is there any other way I may
  do it ?</p>
  <pre><code>@Profile(&quot;MyProfile&quot;)
  @Bean(initMethod = &quot;init&quot;, name = &quot;MyConfig&quot;)
  @ConfigurationProperties(prefix = &quot;config&quot;)
  public MyConfig config() {
      MyConfig config = new MyConfig();
      return config;
  }
  
  @Profile(&quot;!MyProfile&quot;)
  @Bean(initMethod = &quot;anotherInit&quot;, name = &quot;MyConfig&quot;)
  @ConfigurationProperties(prefix = &quot;config&quot;)
  public MyConfig myConfig() {
      MyConfig config = new MyConfig();
      return config;
  }
  </code></pre>
  <p><strong>UPDATE:</strong></p>
  <blockquote>
  <p>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project my-app: Compilation failure:
  Compilation failure:</p>
  </blockquote>
  <blockquote>
  <p>[ERROR] ...MyConfig.java:[21,22] Duplicate <code>@ConfigurationProperties</code> definition for prefix 'config'</p>
  </blockquote>