title: Is it possible to override the configuration of a plugin already defined for a profile in a parent POM?
body: <p>In a POM parent file of my project, I have such a profile defining some configurations useful for this project (so that I can't get rid of this parent POM) :</p>
  
  <pre><code>&lt;profile&gt;
  &lt;id&gt;wls7&lt;/id&gt;
  ...
  &lt;build&gt;
    &lt;plugins&gt;
      &lt;!-- use java 1.4 --&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
        &lt;configuration&gt;
          &lt;fork&gt;true&lt;/fork&gt;
          &lt;source&gt;1.4&lt;/source&gt;
          &lt;target&gt;1.4&lt;/target&gt;
          &lt;meminitial&gt;128m&lt;/meminitial&gt;
          &lt;maxmem&gt;1024m&lt;/maxmem&gt;
          &lt;executable&gt;%${jdk14.executable}&lt;/executable&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
  
  ...
  &lt;/profile&gt;
  </code></pre>
  
  <p>But in my project I just would like to override the configuration of the maven-compiler-plugin in order to use jdk5 instead of jdk4 for compiling test-classes.</p>
  
  <p>That's why I did this section in the POM of my project :</p>
  
  <pre><code>&lt;profiles&gt;
    &lt;profile&gt;
      &lt;id&gt;wls7&lt;/id&gt;
          &lt;activation&gt;
              &lt;property&gt;
                  &lt;name&gt;jdk&lt;/name&gt;
                  &lt;value&gt;4&lt;/value&gt;
              &lt;/property&gt;
          &lt;/activation&gt;
      &lt;build&gt;
        &lt;directory&gt;target-1.4&lt;/directory&gt;
        &lt;plugins&gt;
          &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
            &lt;executions&gt;
              &lt;execution&gt;
                &lt;id&gt;my-testCompile&lt;/id&gt;
                &lt;phase&gt;test-compile&lt;/phase&gt;
                &lt;goals&gt;
                  &lt;goal&gt;testCompile&lt;/goal&gt;
                &lt;/goals&gt;
                &lt;configuration&gt;
                  &lt;fork&gt;true&lt;/fork&gt;
                  &lt;executable&gt;${jdk15.executable}&lt;/executable&gt;
                  &lt;compilerVersion&gt;1.5&lt;/compilerVersion&gt;
                  &lt;source&gt;1.5&lt;/source&gt;
                  &lt;target&gt;1.5&lt;/target&gt;
                  &lt;verbose&gt;true&lt;/verbose&gt;
                &lt;/configuration&gt;
              &lt;/execution&gt;
            &lt;/executions&gt;
          &lt;/plugin&gt;
        &lt;/plugins&gt;
      &lt;/build&gt;
    &lt;/profile&gt;
                ...
  &lt;/profiles&gt;
  </code></pre>
  
  <p>and it's not working ...</p>
  
  <p>I even tried to override the configuration in regular plugin sections of my POM (I mean, not for a specific profile but for my whole POM).</p>
  
  <p>What could be the problem ?</p>
  
  <p>To clarify some of my requirements :</p>
  
  <ul>
  <li>I don't want to get rid of the parent
  POM and the profile (wls7) defined 
  inside it (since I need many and many
  properties, configurations, ...) and
  that is not the process in my
  company.</li>
  <li>A solution based on    duplicating
  the parent POM and/or the    profile
  defined inside it is not a good
  one. Since if the responsible of<br>
  the parent POM change something, I<br>
  would have to report it in mine.</li>
  </ul>
  
  <p>It's just an inheritance matter (extend or override a profile, a configuration from an upper-level POM) so I think it should be possible with Maven 2.</p>