On 04/27/2012 01:39 PM, Hilco Wijbenga wrote:
What about -am and -amd?

-am does work together with -pl. Vincent's issue is that -pl must be given a 
full list of submodules; just passing an aggregator is not enough. For example, 
take

top
+- libs
|  +- lib1
|  +- lib2
+- apps
   +- app1
   |  +- mod1 > [lib1]
   |  +- mod2 > []
   +- app2
      +- mod1 > []
      +- mod2 > [lib2]

where top, libs, apps, app1, and app2 are aggregator projects. Now say you want 
to build the first application. What should you do?

1. 'cd apps/app1 && mvn' will not work unless lib1 has been previously built; 
-am does not help.

2. 'mvn -pl apps/app1 -am' will just install app1-$version.pom; it does not recurse 
into mod1 & mod2. (*)

3. 'mvn -pl apps/app1,apps/app1/mod1,apps/app1/mod2 -am' works (builds also 
lib1) but requires you on the command line to determine what the submodules of 
apps/app1 are.

My own MNG-5059 [1] is a little related: the Maven CLI offers only limited options for building a set of modules. Perhaps there should be a DSL for selecting subsets of a reactor tree in various ways and building the subsets thus calculated to particular phases, all within a single CLI invocation. The old reactor:make could be revamped to do this, I guess, leaving M3's built-in options just for the simplest cases.

(*) As Jason points out, existing systems may rely on an aggregator project passed to -pl being interpreted without recursion. In particular, NetBeans IDE "priming builds" rely on this behavior.

[1] http://jira.codehaus.org/browse/MNG-5059


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to