Thanks Stevo! Forgot to metion that it does work fine in eclipse (I'm using m2eclipse plugin but it fails when I compile it from the CLI). I will give the above project a shot. Thanks again Mohan
On Sat, Nov 29, 2008 at 6:05 PM, Stevo Slavić <[EMAIL PROTECTED]> wrote: > Hello Mohan, > > Attached you can find an archive with eclipse maven multi-module project > created as one you've described, so you can see transitive dependencies are > working as expected. Your project is obviously somewhat different than what > you described, and it is having effect on dependencies not being passed on. > Check dependency scope and read > this<http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html>, > maybe it will help. > > Regards, > Stevo. > > > On Sun, Nov 30, 2008 at 12:20 AM, Mohan K R <[EMAIL PROTECTED]> wrote: > >> It appears that I'm missing something critical here, so please help me >> out. >> I have a standard >> multi-module project like this. (I'm using Maven 2.0.9, JDK5). >> >> parent (P) - >> |- module A >> |- module B >> |- module C >> >> >> A,B,C all inherit from the parent P. >> >> Now in my parent POM (P): I have a dependencyManagement section in the >> POM. >> <depedencyManagement> >> <dependencies> >> <dependency> >> <groupId>log4j</groupId> >> <artifactId>log4j</artifactId> >> <version>1.2.14</version> >> <dependency> >> <... bunch of others ...> >> <dependencies> >> </dependencyManagement> >> >> Now in module A (I have a dependency on log4j), so only thing that I >> provide >> is (notice no version): >> >> <dependencies> >> <dependency> >> <groupId>log4j</groupId> >> <artifactId>log4j</artifactId> >> <dependency> >> <... bunch of others ...> >> <dependencies> >> >> Now in module B depends on module A so I have this in my dependency: >> <dependencies> >> <dependency> >> <groupId>${project.groupId}</groupId> >> <artifactId>module_A</artifactId> <!-- NOTICE MODULE A --> >> <version>${project.version}</version> >> <dependency> >> <... bunch of others ...*but no log4j*> >> <dependencies> >> NOTE: I do use log4j in B, but it got transitively pulled in. So far so >> good. >> >> Now Module C, depends on Module B. So what I have is: >> <dependencies> >> <dependency> >> <groupId>${project.groupId}</groupId> >> <artifactId>module_B</artifactId> <!-- NOTICE MODULE B >> --> >> <version>${project.version}</version> >> <dependency> >> <... bunch of others ...> >> <dependencies> >> Now, I do use some log4j calls (LogFactory), but for some reason log4j >> does >> not >> get pulled in transitively??? I have to explicitly give a dependency on >> log4j *or* >> module_A to get it to compile?? >> >> My first that was, all transitive dependencies on module_B should get >> pulled >> in which >> means module_A and in turn its transitive dependency log4j. But nothing of >> this sort >> is happening? Any ideas? Is it the dependecyManagement section (which has >> the version) >> that is messing me up, since C does inherit from P? >> >> Thanks >> Mohan K >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >