Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to "extend" a profile in a child module? [duplicate]

Tags:

java

maven

say i have a parent pom A, with profiles win32 and win64 activated by os:

<profile>
    <id>windows32</id>
    <activation>
        <os>
            <family>windows</family>
            <arch>x86</arch>
        </os>
    </activation>
    <properties>
        <envClassifier>win-x32</envClassifier>
    </properties>
</profile>
<profile>
    <id>windows64</id>
    <activation>
        <os>
            <family>windows</family>
            <arch>amd64</arch>
        </os>
    </activation>
    <properties>
        <envClassifier>win-x64</envClassifier>
    </properties>
</profile>

those profiles define env. variables like ${envClassifier} etc. say that parent module has a child module B which would like to define some extra stuff IN ADDITION on win64:

<profile>
    <id>windows64</id>
    <properties>
        <jreName>jre6u27.zip</jreName>
    </properties>
</profile>

can i somehow extend the win64 profile from the parent, or am i doomed to copy-and-paste it along with its activation section and everything?

like image 596
radai Avatar asked Jul 10 '12 05:07

radai


2 Answers

apparently its simply impossible. i found a good explanation here - http://www.dashbay.com/2011/03/maven-profile-inheritance/

like image 63
radai Avatar answered Oct 04 '22 01:10

radai


I just checked this case using mvn help:effective-pom.

Provided you specify <activation> section for the child profile the same way as for the parent profile, properties of these 2 profiles will be merged.

like image 35
Andrew Logvinov Avatar answered Oct 04 '22 01:10

Andrew Logvinov