Don't worry, it will work as expected:

If you have a multi-level project (X) which contains 2 modules A & B,
and if you have B depends on A in POM, once you build X, it will
help u to build A first and then B, and it will use the local copy of
A when building B.

"Using A from repository" will happens only when you build directly
in B

--
Best Regards,
AdRiAN ShUM


-----Original Message-----
From: Ilya Kazakevich [mailto:kazakev...@devexperts.com] 
Sent: Wednesday, January 27, 2010 5:08 AM
To: users@maven.apache.org
Subject: Dependencies in multi-module project


Hello.

Say, I have two projects: A and B. I always want them to be compiled and
deployed in one time and I decided to use multi-module project: 

In the upper directory I've created pom.xml with the following content: 
<modules>
        <module>A</module>
        <module>B</module>
</modules>

And it works fine.

But module B depends on module A.

When I do some changes in A and run "mvn compile" on the top level, I
want both modules to be recompiled and module "B" should be compiled
with newly compiled "A". 

How can I do it?

If I simply add dependency in module "B"'s pom.xml -- it will use "A"
from repository, and if I did not do "mvn deploy" there would not be
one!

Of course I can add "system" dependency to module "B" and hardcode path
to module "A" (like "../A/target/classes") but that's an ugly hack.

What is the best way to do that?

Thanks.

====================
WBR, Ilya Kazakevich





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



This email is confidential. If you are not the intended recipient, please 
delete it from your system and notify the sender immediately. Any unauthorized 
use, disclosure, dissemination or copying of this email is prohibited. Taifook 
Securities Group, its group companies and their content providers ("Parties") 
shall not be responsible for the accuracy or completeness of this email or its 
attachment, if any, which could contain virus, be corrupted, destroyed, 
incomplete, intercepted, lost or arrive late.   The Parties do not accept 
liability for any damage caused by this email.


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

Reply via email to