Hi Benjamin,

On Dec 9, 2009, at 12:04 AM, Benjamin Bentmann wrote:

> Donszelmann Mark wrote:
> 
>> Is it correct that it compiles and tests fine without ever running into the 
>> install phase... That is, maven probably sorts out that B is dependent on A, 
>> and thus in this multi-module project:
>> 1. B does not download A,
>> 2. B just refers to module A.
> 
> In principle yes, during a reactor build inter-module dependencies are 
> satisfied by the build output of the corresponding project, i.e. 
> "target/some.jar" or "target/classes" (if existent) in case we have no JAR 
> yet.

ok, so I want to do something similar for "include" directories and machine 
specific libraries both stored in A library under target created by the nar 
plugin. 

> 
>> I figured out how to get all the projects in a multi-module project, and can 
>> calculate the path to the include and libs of A, BUT it seems like maven 
>> still wants to download A before I can
>> do anything, so maybe my assumption was incorrect ?
> 
> It's not clear to me what your plugin does, when it does with respect to the 
> lifecycle and what the project setup looks like where you encounter problems.

the nar compiles and links c, c++ etc into libraries, and packs them in nar 
files (jars). These get attached to the main jar file and installed on the 
repository.
When downloaded by a dependent project they get unpacked in the local 
repository so that include files and libraries are available to the compiler.

For a multi-project not doing "install" I would need to search and find these 
libraries in the other modules. As they have not been packed, they are still in 
target. 

> 
> If your goals use @requiresDependencyResolution, this will by design trigger 
> resolution before your goal is invoked. Maven 3 supports an alternative 
> annotation @requiresDependencyCollection that allows to determine the set of 
> dependency artifacts without resolving their files (MNG-4331), maybe that 
> fits better your intentions.
> 

Ok, so this is what I do not really understand. In Maven 2 the CompileMojo, 
which I assume has "@requiresDependencyResolution compile", knows not to 
download or search the local repo for
the A, as it is available in the multi-module project. Where in the code does 
it do this. 

Thanks for your help so far.
Regards
Mark


> 
> Benjamin
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to