Friday, May 6, 2011

Carrying over dependencies in Maven

I am working on 3 maven projects. They're all separate projects, but they share a common base framework. Let's call the framework A and its dependencies B and C.

There is a library L that A depends on. Any package that uses A will also need to use L, and it will need to use the same version of L that A does. For this reason, I would like a way to specify L in A's pom and only in A's pom. I don't want to have to go and edit B and C's poms every time I upgrade L.

Is there a way to do this? There's not a parent pom that A, B, and C share.

From stackoverflow
  • If B and C also uses library L directly then you should define that in B and C pom file. Since its a direct dependency it should be clear by looking into POM file.

    Second option is if library L is common to A, B and C projects then you should define a parent pom.

0 comments:

Post a Comment