maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Markus <t.mar...@proventis.net>
Subject question about profile inheritance
Date Fri, 05 Feb 2010 11:39:41 GMT
hi,

i try to define profiles in a parent pom and activate these profiles in
a child pom. its a little bit confusion.

in child project part1

mvn help:active-profiles

shows
 - test1 (source: pom)
 - base (source: settings.xml)

but a

mvn

doesn't runs my plugin (no inheritance)

but a

mvn -P test1

(expected to be same)

executes the plugin

what i'm missing here? i try to define profiles for different project
configurations.

regards
Thomas



parent pom:

------------------------------------------------------------------------
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>MavenTest</groupId>
    <artifactId>Main</artifactId>
    <packaging>pom</packaging>
    <version>0.0.1-SNAPSHOT</version>

    <modules>
        <module>part1</module>
    </modules>

    <build>
        <defaultGoal>initialize</defaultGoal>
    </build>

    <profiles>
        <profile>
            <id>test1</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>runtest1</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <tasks>
                                        <echo
message="#########################################" />
                                        <echo message="lets run test1" />
                                        <echo
message="#########################################" />
                                    </tasks>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
------------------------------------------------------------------------

child pom:
------------------------------------------------------------------------
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>MavenTest</groupId>
    <artifactId>part1</artifactId>

    <parent>
        <groupId>MavenTest</groupId>
        <artifactId>Main</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <relativePath>..</relativePath>
    </parent>

    <profiles>
        <profile>
            <id>test1</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
    </profiles>

</project>
------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message