On Fri, Apr 27, 2012 at 8:40 AM, J.V. <[email protected]> wrote: > I understand how Maven resolves dependencies (and transitive dependencies) > at compile time, but does it bring anything to the table at run time? > For example, if I have in my application dependency list two versions of > log4J (let's say version 8 and version 15), will I deploy both jars/version > along with my app on say a tomcat server inside the war? > At runtime which one does it choose? If I am executing the code that > depends on version 8, how would the correct jar be in the classpath at that > point and later log4J version 15 be in my classpath when code that has that > dependency executes?
Surprised that nobody else mentioned this, but assuming your GA (Group, Artifact) coordinates stay the same, Maven would pick only *one* version of the same artifact to be included in your classpath, as a dependent lib for your WAR or whatever else it is you are building. Google on on "Maven nearest version resolution" to find out more. There's no need for exclusions (in that case). Kalle > > At runtime, Maven is out of the picture correct? This is a missing piece > for me. > > thanks > > J.V. > > --------------------------------------------------------------------- > 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]
