title: How to passing Maven Profiles value to Spring Bean XML
body: <p>I'm new in Spring &amp; Maven, I think my question is simple. But I cannot to figure and setup it. I have Maven POM like below:</p>
  
  <pre><code>&lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;qa&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;db.driverClassName&gt;oracle.jdbc.driver.OracleDriver&lt;/db.driverClassName&gt;
              &lt;db.url&gt;jdbc:oracle:thin:@10.148.36.89:1521:mmki&lt;/db.url&gt;
              &lt;db.username&gt;APW&lt;/db.username&gt;
              &lt;db.password&gt;apw&lt;/db.password&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;prod&lt;/id&gt;
          &lt;properties&gt;
              &lt;db.driverClassName&gt;oracle.jdbc.driver.OracleDriver&lt;/db.driverClassName&gt;
              &lt;db.url&gt;jdbc:oracle:thin:@10.148.36.88:1521:mmki&lt;/db.url&gt;
              &lt;db.username&gt;APW&lt;/db.username&gt;
              &lt;db.password&gt;apw&lt;/db.password&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>My question is how I can passing the value from Maven profile to Spring bean property like below:</p>
  
  <pre><code>&lt;!-- QA ENVIRONMENT --&gt;
  &lt;!-- &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
      &lt;property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" /&gt;
      &lt;property name="url" value="jdbc:oracle:thin:@10.148.36.89:1521:mmki" /&gt;
      &lt;property name="username" value="APW" /&gt;
      &lt;property name="password" value="apw" /&gt;
  &lt;/bean&gt; --&gt;
  
  &lt;!-- PRD ENVIRONMENT --&gt;
  &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
      &lt;property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" /&gt;
      &lt;property name="url" value="jdbc:oracle:thin:@10.148.36.88:1521:mmki" /&gt;
      &lt;property name="username" value="APW" /&gt;
      &lt;property name="password" value="apw" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I'm so dumb for this question, but please everyone to answer and explain with the simple method.</p>
  
  <p>Many thanks.</p>