You can use profiles to enable the optional building of submodules (you can use a top-level aggregating pom if the projects are distinct). Note that, if you have built a module locally, maven will use the version from your local repo if it is newer than a deployed version. If not built locally, maven will download the dependency from a remote repo. I think this is what you want.

When you run maven, specify -P options to enable profiles to turn on optional submodules. You can have multiple profiles active at once:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

As an example, GeoTools and GeoServer use profiles to enable the building of optional plugins. Here is the pom for unsupported GeoTools plugins:
http://svn.osgeo.org/geotools/trunk/modules/unsupported/pom.xml

A similar technique is used for GeoServer extensions:
https://svn.codehaus.org/geoserver/trunk/src/extension/pom.xml

Kind regards,
Ben.

On 10/11/10 06:36, KARR, DAVID (ATTSI) wrote:

  I currently work on a large enterprise app built with Ant.  The app is
divided into several projects divided into functional areas.  In order
to build the entire EAR, all of the projects have to be built, even if
you're only working on a single one of those projects.

I'm examining how we could make this work better if we were using Maven.

I guess a straightforward implementation of this would have a main
project POM that specifies all the subprojects as submodules, and also
their artifacts as dependencies.

It almost seems to me that what I need is the ability to have the main
POM be somewhat "dynamic", such that if I'm only working on a single one
of those subprojects, but I need to assemble the EAR containing all of
the artifacts, then the projects that I don't have checked out would get
their submodule entry temporarily deleted, and I would get their
artifacts from the intranet repo.

I would be using m2eclipse.

Does any of this make sense?

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




--
Ben Caradoc-Davies <[email protected]>
Software Engineering Team Leader
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to