I have a project with several different types of modules - some are
libraries (stand-alone jars), some are wars, some are executables (jars
plus some extra plugins to generate batch files and create an assembly).
I would like to put the configuration for all these different project
types in to my top-level pom, and then have each module activate only
the plugin configurations that apply to its type. Profiles seem a
natural way to do this, but I can't find any way to explicitly activate
them from a module.

Using the activeProfiles element in settings.xml doesn't make sense
since the profile I want to activate will differ depending on the
module. I tried using a profiles.xml and setting the activeProfiles
there, but unfortunately that only applies to the profiles defined in
profiles.xml.

Is there another way to do what I want?

Here's an example:

pom.xml
-------------
<project>
 
  <groupId>test</groupId>
  <artifactId>parent</artifactId>    

  <profile>
    <id>library</id>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>foo</groupId>
          <artifactId>foo</artifactId>
          <configuration>
              ...
           </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </profile>

  <profile>
    <id>webapp</id>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>foo</groupId>
          <artifactId>foo</artifactId>
          <configuration>
              ... (different than the library profile's configuration)
           </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </profile>

</project> 

child/pom.xml
---------------------
<project>
  <parent>
    <groupId>test</groupId>
    <artifactId>parent</artifactId>
  </parent>
  <groupId>test</groupId>
  <artifactId>child</artifactId>

  ...what do I do here to activate the library profile?...
</project>

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

Reply via email to