this is the issue (that only one artifact is picked). How does it know to pick the right one?

What if log4j ver 1.2.15 has a method that log4j 1.2.10 does not have?

also what if both jars have a method with the same signature but function differently?

In this case you need both jars and at runtime to have the right jar in the classpath for that piece of code.

J.V.

On 4/27/2012 11:55 AM, Kalle Korhonen wrote:
On Fri, Apr 27, 2012 at 8:40 AM, J.V.<jvsr...@gmail.com>  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: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

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



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

Reply via email to