Norbert,

MNG-5582 and MNG-5557 along with MNG-5578 are my attempts to start changing the 
way the reactor can work. The default implementation is there and I have 
another implementation I use. That's the impetus of the work.

MNG-5582 specifically aligns the build space with the resolution space. Meaning 
specifically that if you use -pl to build a subset of projects those are the 
only projects that can be resolved in the reactor. Previously what would happen 
is that you would build a subset of projects but resolve against the projects 
in the reactor. This didn't break any of our ITs and shouldn't cause any 
behavioural changes except for being more correct.

MNG-5557 allows access to all the projects in the reactor in the event you want 
to use them. I use this in conjunction with MNG-5578 to create a reactor that 
has different resolution semantics. If you have a multi-module projects and you 
step into a directory to build a project and that project depends on a project 
sitting in the next directory Maven will not use it and go to the local 
repository. I have a reactor that takes into context the projects around it and 
I'm experimenting with how to mimic IDE workspace resolution on the command 
line.

I will unpack your project and take a look. But yes the -pl command does a pure 
dependency graph calculation and so modules are not taken into consideration 
here as modules, strictly speaking, are not dependencies and not represented as 
such in the reactor. If they were before we don't have an IT to catch that 
behaviour. I'll compare 3.1.1 and 3.2.1 and create a JIRA issue to track it.

On Mar 10, 2014, at 7:54 AM, Norbert Wnuk <norbertw...@gmail.com> wrote:

> Hi All,
> I would like to get a clarification for Maven behavior when -pl (--projects) 
> and -am (--also-make) / -amd (--also-make-dependents) options are used 
> together on parent POM level in multi-module project. Attachment contains the 
> project where I would like to 'fully' rebuild module-a only (all sub-modules 
> and further downstream dependencies). The most crucial part here is that 
> module-b (e.g. common library) is outside of module-a subtree and I don't 
> want to build module-c the same time - thought that MNG-5582 is referring to 
> similar use case. However it seems that there is no effective way to achieve 
> such goal in both maven 3.1.1 and 3.2.1 (MNG-5557) other than option (e). 
> From my perspective this is a significant limitation (second most often use 
> case for -pl option in my project) so I decided to change default behavior 
> for -am option (c) to automatically add all modules to the list of selected 
> projects to have consistency between (c) and (e).
> Is it a valid use case in your opinion? If so, how the proper fix / 
> enhancement should be done since possible changes in both -am and -amd 
> options are not backward compatible with current behavior?
> 
> (a) mvn clean install
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] top-level-parent .................................. SUCCESS [  0.453 s]
> [INFO] module-b .......................................... SUCCESS [  1.258 s]
> [INFO] module-a-parent ................................... SUCCESS [  0.011 s]
> [INFO] module-a1 ......................................... SUCCESS [  0.072 s]
> [INFO] module-a2 ......................................... SUCCESS [  0.068 s]
> [INFO] module-c .......................................... SUCCESS [  0.086 s]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> 
> (b) mvn -pl module-a clean install
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> 
> (c) mvn -pl module-a -am clean install
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] top-level-parent .................................. SUCCESS [  0.503 s]
> [INFO] module-a-parent ................................... SUCCESS [  0.010 s]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> 
> (d) mvn -pl module-a -am -amd clean install // module-b is ignored
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] top-level-parent .................................. SUCCESS [  0.455 s]
> [INFO] module-a-parent ................................... SUCCESS [  0.010 s]
> [INFO] module-a1 ......................................... SUCCESS [  1.275 s]
> [INFO] module-a2 ......................................... SUCCESS [  0.069 s]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> 
> (e)  mvn -pl module-a/module-a1,module-a/module-a2 -am clean install
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] top-level-parent .................................. SUCCESS [  0.453 s]
> [INFO] module-b .......................................... SUCCESS [  1.187 s]
> [INFO] module-a-parent ................................... SUCCESS [  0.018 s]
> [INFO] module-a1 ......................................... SUCCESS [  0.075 s]
> [INFO] module-a2 ......................................... SUCCESS [  0.072 s]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> 
> Regards,
> NW
> <test.project.zip>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/takari_io
---------------------------------------------------------

We all have problems. How we deal with them is a measure of our worth.

 -- Unknown









Reply via email to