File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Override dependencies of third party jar in maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Override dependencies of third party jar in maven" Watch "Override dependencies of third party jar in maven" New topic

Override dependencies of third party jar in maven

Raihan Jamal
Ranch Hand

Joined: Mar 23, 2010
Posts: 86
Like this org.carrot2 is depending on commons-httpclient 3.1 So how I can change this commons-httpclient 3.1 to HttpClient 4.1.1. I am working in eclipse. As I want to remove commons-httpclient:3.1 from those who are depending on this jar file and I want to replace with HttpClient 4.1.1.

So what I was trying to do.. I doubled click on this org.carrot2 from dependency hierarchy folder and went into its pom.xml file and was trying to change commons-httpclient 3.1 to httpclient 4.1.1 but it is not allowing me to change as backspace and delete is not working on that..

Any suggestions will be appreciated..
Vijitha Kumara

Joined: Mar 24, 2008
Posts: 3900

So you are trying to modify a third party library jar (this may include the library being compiled with the new dependency) file and distribute it with your application to the client?
I'm not sure about any licencing issues with this, but we'll leave it aside for the moment. Are you not trying to modify the extracted jar here?

[EDIT]Changed to licencing instead copyright[/EDIT]

[How to ask questions] [Twitter]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17256

There are some restrictions on this, but for the most part, if you have a POM that has a dependency that has a sub-dependency on an older version of a jar, you can specify the newer version in your POM and that version will be the one and only version that is installed and bound to your target.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Override dependencies of third party jar in maven
It's not a secret anymore!