title: How to acess a property under specific profile in Maven
body: <p>I have 2 pom files - ParentPOM and ChildPOM. I want to Access property1 in ParentPOM in ChildPOM. I know this can be done by making ParentPOM as the parent for ChildPOM and use ${property1}. But property1 is defined in 2 profiles - trunk and release and I always want to get the value of property1 defined in release. How do I do that? ie:- In the below example, I want the value should be 0.0.2 and not 0.0.1 when I Access property1 in ChildPOM.</p>
  
  <p>Note:<strong>I cannot modify ParentPOM</strong></p>
  
  <pre><code>&lt;project&gt;
      &lt;modelVersion&gt;x.x.x&lt;/modelVersion&gt;
      &lt;artifactId&gt;ParentPOM&lt;/artifactId&gt;
      &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;name&gt;ParentPOM&lt;/name&gt;   
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;trunk&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;properties&gt;        
          &lt;property1&gt;0.0.1&lt;/property1&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
          &lt;profile&gt;
              &lt;id&gt;release&lt;/id&gt;
              &lt;properties&gt;
                  &lt;property1&gt;0.0.2&lt;/property1&gt;
          &lt;/properties&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  &lt;/project&gt;
  
  &lt;project&gt;
      &lt;modelVersion&gt;x.x.x&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;com.temp&lt;/groupId&gt;
          &lt;artifactId&gt;ParentPOM&lt;/artifactId&gt;
          &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;/parent&gt;
      &lt;artifactId&gt;ChildPOM&lt;/artifactId&gt;
      &lt;version&gt;2.0.0&lt;/version&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;name&gt;ChildPOM&lt;/name&gt;   
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;trunk&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;properties&gt;        
          &lt;property1&gt;x.x.x&lt;/property1&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
          &lt;profile&gt;
              &lt;id&gt;release&lt;/id&gt;
              &lt;properties&gt;
                  &lt;property1&gt;y.y.y&lt;/property1&gt;
          &lt;/properties&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.xxx&lt;/groupId&gt;
              &lt;artifactId&gt;xxx&lt;/artifactId&gt;
              &lt;version&gt;${property1}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>