Is it possible to override the configuration of a plugin already defined for a profile in a parent POM?

Overriding configurations from a parent pom can be done by adding the combine.self="override" attribute to the element in your pom.

Try changing your plugin configuration to:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <executions>
        <execution>
          <id>my-testCompile</id>
          <phase>test-compile</phase>
          <goals>
            <goal>testCompile</goal>
          </goals>
          <configuration combine.self="override">
            <fork>true</fork>
            <executable>${jdk15.executable}</executable>
            <compilerVersion>1.5</compilerVersion>
            <source>1.5</source>
            <target>1.5</target>
            <verbose>true</verbose>
          </configuration>
        </execution>
      </executions>
    </plugin>

For more information on overriding plugins, see: http://maven.apache.org/pom.html

Leave a Comment