Search code examples
javamavenmaven-3maven-extension

In Maven extensions is it possible to add <configuration> block in the pom.xml like we do for plugins?


We have a Maven extension which does some post actions at the end of build, but we want to extended its features by adding some flags/properties/something else in <configuration> block same as the way we do for plugin configurations in pom.xml. Is it possible to do that?

We tried adding it in pom.xml but it is throwing exceptions during build, also didn't managed find it in the docs.

Want to have something like below in the pom.xml:

<build>
  ...
  <extensions>
    ...
    <extension>
      <groupId>org.apache.maven.extensions</groupId>
      <artifactId>maven-test-extension</artifactId>
      <version>1.0-SNAPSHOT</version>
      <configuration>
        ....
      </configuration>
    </extension>
    ...
  </extensions>
  ...
</build>

Solution

  • We tried it in different way, we have configured the extension as plugin using <extention>true</extension> in pom.xml and it accepts the <configuration>....</configuration> block.