You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by adrien ruffie <ad...@hotmail.fr> on 2013/01/07 10:51:59 UTC

Dependencies question

I also have another question.

 

In my application I have the following dependency:

 

org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.2:compile  pulled
by org.apache.axis2:addressing:mar:1.5.1:compile

javax.mail:mail:jar:1.4:compile also pulled by axis2:addressing:

 

+- org.apache.axis2:addressing:mar:1.5.1:compile

[INFO] |  +- org.apache.ws.commons.axiom:axiom-api:jar:1.2.8:compile

[INFO] |  |  +-
org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.1:compile

[INFO] |  |  +-
org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.2:compile

[INFO] |  |  \- jaxen:jaxen:jar:1.1.1:compile

[INFO] |  +- org.apache.ws.commons.axiom:axiom-impl:jar:1.2.8:compile

[INFO] |  +- org.apache.ws.commons.axiom:axiom-dom:jar:1.2.8:compile

[INFO] |  +- javax.mail:mail:jar:1.4:compile

[INFO] |  +- xalan:xalan:jar:2.7.0:compile

 

and com.sun.mail:javax.mail:jar:1.4.4:compile pulled by another dependency I
my application.

Can't I exclude 2 of these 3 dependencies ... and which of them ?

 

 

xerces:xercesImpl:jar:2.8.1:compile pulled by
net.sourceforge.nekohtml:nekohtml:jar:1.9.7:compile

 

In fact that xeces is already embedded into java 6 can I exclude 2.8.1 ?
because my last exclude was xercesImpl 2.7.1 and

I have javax.mail:mail:jar:1.4:compile pull

 

And how can I be sure that there will be no problem in execution due to
exclusions?


Re: Dependencies question

Posted by Ron Wheeler <rw...@artifact-software.com>.
If a library A that you call, calls a method "mailme" in library B ,  
you can not remove that library unless you are supplying a later version 
of the library B with the "mailme" method through another dependency. If 
"mailme" was deprecated and removed in the later version of B, you will 
not be able to use the latest version and will be forced to use the 
version that library A depends on.

If you have a direct dependency on javax.mail:mail:jar:1.4:compile in 
your pom, it would be a good idea to exclude that library in other 
dependencies so that you get the version that you want.
This does make you responsible for ensuring that the version that you 
specify is high enough to satisfy the needs of the other libraries that 
you use.
If you specify version 1.3 and you have a dependency that requires 1.4, 
you may get run-time problem such as MethodNotFound or bugs showing up 
that were fixed in 1.4.

If you do not do the exclude, Maven will sort it out in a logical way 
which will get you highest version required.

If the version of Xerces that ships with the JDK that you are using is 
high enough to satisfy the dependencies that your dependency tree needs, 
then Maven will find it and use it.


The easiest way to determine if you have a setup that will execute is to 
test it.
Looking at the Maven dependency hierarchy will save a bit of time but 
depends on your attention to detail.

Ron



On 07/01/2013 4:51 AM, adrien ruffie wrote:
> I also have another question.
>
>   
>
> In my application I have the following dependency:
>
>   
>
> org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.2:compile  pulled
> by org.apache.axis2:addressing:mar:1.5.1:compile
>
> javax.mail:mail:jar:1.4:compile also pulled by axis2:addressing:
>
>   
>
> +- org.apache.axis2:addressing:mar:1.5.1:compile
>
> [INFO] |  +- org.apache.ws.commons.axiom:axiom-api:jar:1.2.8:compile
>
> [INFO] |  |  +-
> org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.1:compile
>
> [INFO] |  |  +-
> org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.2:compile
>
> [INFO] |  |  \- jaxen:jaxen:jar:1.1.1:compile
>
> [INFO] |  +- org.apache.ws.commons.axiom:axiom-impl:jar:1.2.8:compile
>
> [INFO] |  +- org.apache.ws.commons.axiom:axiom-dom:jar:1.2.8:compile
>
> [INFO] |  +- javax.mail:mail:jar:1.4:compile
>
> [INFO] |  +- xalan:xalan:jar:2.7.0:compile
>
>   
>
> and com.sun.mail:javax.mail:jar:1.4.4:compile pulled by another dependency I
> my application.
>
> Can't I exclude 2 of these 3 dependencies ... and which of them ?
>
>   
>
>   
>
> xerces:xercesImpl:jar:2.8.1:compile pulled by
> net.sourceforge.nekohtml:nekohtml:jar:1.9.7:compile
>
>   
>
> In fact that xeces is already embedded into java 6 can I exclude 2.8.1 ?
> because my last exclude was xercesImpl 2.7.1 and
>
> I have javax.mail:mail:jar:1.4:compile pull
>
>   
>
> And how can I be sure that there will be no problem in execution due to
> exclusions?
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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