0

I have a multi modules project and wrote an extension. I want to use extension only for parent build, but when I add my extension in parent , it is executed for child module too. Is it possible to configure this behavior?

UPDATE

Parent pom

...
<modules>
    <module>first</module>
    <module>first</module>
</modules>

<build>
        <extensions>
            <extension>
                <groupId>com.my.ext</groupId>
                <artifactId>extension</artifactId>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>

Child pom

....   
<parent>
     <groupId>com.backend</groupId>
     <artifactId>first</artifactId>
     <version>PROJECT-SNAPSHOT</version>
     <relativePath>../config</relativePath>
</parent>
 ...
Maxim Popov
  • 1,167
  • 5
  • 9
  • Can you show a pom file and best would be also what you extension is doing ? And why do you need an extension and can't cope with the usual plugins etc. ? – khmarbaise Apr 05 '18 at 12:42
  • I've added pieces of maven pom. I have to configure environments before childs builds if some of modules will be participate in build. I use a regexp for check if there is this module exist in maven session and do some actions. And also I should remove my changes after build. I tried to write plugin. I used false preferences, but can not pick up phase before building child modules and after. – Maxim Popov Apr 05 '18 at 13:26
  • What kind of configuration for environments for childs? I think you are talking about things like DEV / TEST / PROD ? Using different properties for those different environments? – khmarbaise Apr 05 '18 at 14:23
  • BTW: the child poms contain a relative path which looks like your parent is not one level higher? I would suggest to follow conventions... – khmarbaise Apr 05 '18 at 14:25

0 Answers0