title: How to set spring active profiles with maven profiles
body: <p>I have an application with maven as a build tool.</p>
  
  <p>I am using maven profiles to set up different properties from different profiles.</p>
  
  <p>What i would like to do is that all active profiles in maven will be ported to spring active profiles as well so i can reference them in bean signature (<code>@profile</code>). but i am not sure how to do it.</p>
  
  <p>for example: consider the following maven setup</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;profile1&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;profile2&lt;/id&gt;
          &lt;properties&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;development&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;production&lt;/id&gt;
          &lt;properties&gt;    
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>assuming i run maven with out specifying any other profiles i would like for spring to have <code>profile1</code> and  <code>development</code> as active profiles.</p>