java - Override dependencies of third party jar in maven -


like org.carrot2 depending on commons-httpclient 3.1 how can change commons-httpclient 3.1 httpclient 4.1.1. working in eclipse. want remove commons-httpclient:3.1 depending on jar file , want replace httpclient 4.1.1.

so trying do.. doubled click on org.carrot2 dependency hierarchy folder , went pom.xml file , trying change commons-httpclient 3.1 httpclient 4.1.1 not allowing me change backspace , delete not working on that..

any suggestions appreciated..

firstly please ensure mentioned artifact can work httpclient 4.1.1.

we can define "the exclusion" each dependency mentioned @ http://maven.apache.org/pom.html#exclusions

exclusions explicitly tell maven don't want include specified project dependency of dependency (in other words, transitive dependency)

exclusions: exclusions contain 1 or more exclusion elements, each containing groupid , artifactid denoting dependency exclude. unlike optional, may or may not installed , used, exclusions actively remove dependency tree.

<dependencies>   <dependency>     <groupid>the_group</groupid>     <artifactid>the_artifact</artifactid>     <version>the_version</version>     <exclusions>       <exclusion>         <groupid>the_apache_group</groupid>         <artifactid>the_http_client_artifact</artifactid>       </exclusion>     </exclusions>   </dependency>    <dependency>     <groupid>the_apache_group</groupid>     <artifactid>the_http_client_artifact</artifactid>     <version>4.1.1</version>   </dependency>   ... </dependencies> 

i hope may achieve requirement.

regards,

charlee ch.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -