I found an example of what I mean. It's one of our first m2 try-outs which 
used a flat directory-structure, but it serves well enough as an example.

<?xml version="1.0" encoding="UTF-8"?>
<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>at.cfc.hermes.shared</groupId>
        <artifactId>hermes</artifactId>
        <packaging>pom</packaging>
        <name>Hermes</name>
        <version>0.0.1</version>
        <profiles>
                <profile>
                        <id>person</id>
                        <modules>
                                <module>../hermes-logging</module>
                                <module>../hermes-usecase-ui</module>
                                <module>../hermes-geography-link</module>
                                <module>../hermes-security-link</module>
                                <module>../hermes-person</module>
                        </modules>
                </profile>
                <profile>
                        <id>geography-link</id>
                        <modules>
                                <module>../hermes-logging</module>
                                <module>../hermes-usecase-ui</module>
                                <module>../hermes-geography</module>
                                <module>../hermes-geography-link</module>
                        </modules>
                </profile>
                <profile>
                        <id>geography</id>
                        <modules>
                                <module>../hermes-logging</module>
                                <module>../hermes-usecase-ui</module>
                                <module>../hermes-geography</module>
                        </modules>
                </profile>
                <profile>
                        <id>security-link</id>
                        <modules>
                                <module>../hermes-logging</module>
                                <module>../hermes-usecase-ui</module>
                                <module>../hermes-security-link</module>
                        </modules>
                </profile>
        </profiles>
</project>

Now, I had several default launches (in Eclipse), that triggered e.g.:
- mvn -P person
- mvn -P person,geography
- mvn -P person,security-link

As you can see, some modules are defined in more than one profile, this should 
however be no problem. At least, it wasn't in maven 2.0.3 (or 2.0.2, not sure 
where we started) and I think it will still work in the latest version.

Good luck!


On Tuesday 22 May 2007 22:14, Roland Asmann wrote:
> A workaround for this 'problem' could be to specify a couple (a lot?) of
> profiles, that contain the modules you need to combine. You can then run
> maven with the selected profiles, building only those modules you declared
> in the profiles.
> Personally, I'd at least make sure that all modules that have dependencies
> to eachother are grouped inside a profile. Not necessary if your local or
> remote repo has a version, but at least you won't be wondering why certain
> changes 'don't work' when you forget to build a module!
>
> On Tuesday 22 May 2007 21:39, Steven Rowe wrote:
> > Hi Richard,
> >
> > As far as I know, Maven does not have direct support for what you want.
> >
> > But lots of people have been asking for just this functionality recently.
> >
> > See <http://www.nabble.com/Specify-a-dynamic-profile-t3754208s177.html>
> > for a discussion of some workarounds.
> >
> > Steve
> >
> > Richard Allen wrote:
> > > We have a good size multi-module build. To reduce the development cycle
> > > time I would like to be able to say to Maven only include these modules
> > > in the build. That way we could reduce the amount of time it takes to
> > > build the project when testing only a single module. Is that possible?
> > >
> > > Thanks,
> > > Richard
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Roland Asmann

CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien

Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: [EMAIL PROTECTED]
Web: www.cfc.at

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

Reply via email to