Hi all,

This is my first post, necessary as I can't find an answer in the archives ;-)

I'm trying to define profiles, mainly for filtering purpose, on
different modules of my project: local, test and prod, for instance.
I configured my project and modules with inheritance and aggregation,
which is working fine except that profiles defined in the parent's POM
doesn't seem to be inherited by its modules.

Here is an extract from the parent's POM:


  <groupId>parent-groupId</groupId>
  <artifactId>parent-artifactId</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>

  <modules>
    <module>../module1</module>
    <module>../module2</module>
  </modules>

  <profiles>
    <profile>
      <id>local</id>
      <properties>
        <env>local</env>
      </properties>
    </profile>
    <profile>
      <id>dev</id>
      <properties>
        <env>dev</env>
      </properties>
    </profile>
  </profiles>

Here is an extract from the module1's POM:


  <parent>
    <groupId>parent-groupId</groupId>
    <artifactId>parent-artifactId</artifactId>
    <version>1.0-SNAPSHOT</version>
    <relativePath>../parent</relativePath>
  </parent>

  <groupId>module1-groupId</groupId>
  <artifactId>module1-artifactId</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>


The module2's POM is the same with 'module2' as ids and 'war' as packaging.

When launching the following CLI in the parent's base dir :


mvn help:active-profiles -P local


I see :


Active Profiles for Project 'parent-groupId:parent-artifactId:pom:1.0-SNAPSHOT':

The following profiles are active:

- local (source: pom)
- alwaysActiveProfile (source: settings.xml)

Active Profiles for Project
'module1-groupId:module1-artifactId:jar:1.0-SNAPSHOT':

The following profiles are active:

 - alwaysActiveProfile (source: settings.xml)


Active Profiles for Project
'module2-groupId:module2-artifactId:war:1.0-SNAPSHOT':

The following profiles are active:

 - alwaysActiveProfile (source: settings.xml)


Same result with '-P dev' in the CLI, and same problem running the CLI
in a module's base dir.

How can I have 'local' or 'dev' profile active in the modules?

Thanks for your help,

Philippe

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to