Quantcast

Different Dependency Versions in Different Dependencies

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Different Dependency Versions in Different Dependencies

SgtHartman
I have a project called A in Maven that has 2 dependencies: B & C.  B also depends on C.  The problem I have is that A requires C version 2, and B requires C version 1.  Can Maven resolve this problem? If I just set the pom.xml file for B to depend on C version 1 and the pom.xml file for A to depend on C version 2, will that solve my issue? Or do I have to somehow force both project A & B to use the same version of C?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Different Dependency Versions in Different Dependencies

Benson Margulies
If they are all going end up in the classpath together, they all have
to agree on a version. Maven doesn't change the runtime environment.

If you use OSGi, or Guice, you can create a runtime environment
including conflicting versions of jars -- and then you have a set of
maven challenges in setting up to use them.


On Tue, May 31, 2011 at 1:11 PM, SgtHartman <[hidden email]> wrote:

> I have a project called A in Maven that has 2 dependencies: B & C.  B also
> depends on C.  The problem I have is that A requires C version 2, and B
> requires C version 1.  Can Maven resolve this problem? If I just set the
> pom.xml file for B to depend on C version 1 and the pom.xml file for A to
> depend on C version 2, will that solve my issue? Or do I have to somehow
> force both project A & B to use the same version of C?
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Different-Dependency-Versions-in-Different-Dependencies-tp4442689p4442689.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Different Dependency Versions in Different Dependencies

SgtHartman
Benson, Thanks very much for your response.  Looks like my job is going to be harder than I thought.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Different Dependency Versions in Different Dependencies

Benson Margulies
In the event of upward compatibility, you can set up
dependencyManagement for the newest version, and Maven will use it all
down the build. But if the versions are not compatible you've got a
problem.

On Tue, May 31, 2011 at 2:37 PM, SgtHartman <[hidden email]> wrote:

> Benson, Thanks very much for your response.  Looks like my job is going to be
> harder than I thought.
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Different-Dependency-Versions-in-Different-Dependencies-tp4442689p4442934.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...