I am integrating some jar files into a maven project as dependencies. The jar files have been given to me by some project partners. The jar files have dependencies between them. There is also a mix between publicly available jars such as org.apache.http.client
and self-written code. The jars are included in an example application the eclipse-way i.e. using .classpath
. Of course this is not directly portable to Maven. So I did the following:
- I merged the jars into one using
jar -xf
/jar -cf
. - I installed this jar using
mvn install:install-file
. - I added the dependency to my project's
pom.xml
I recreated the example application using the Maven setup and everything seems to work. However, I want to use the library in a more complex situation, a Maven web application.
In this case the code from the jar seems to behave differently:
- the http client flashes debugging messages to the log
- there seems to be some confusion regarding (un-)marshalling of xml / json. This leads to an error message making it impossible for me to use the code.
The problem is that this error is very hard to pin down / fix. Since I don't have access to the source code of the jars I can't figure out what is happening and where. I guess that the problem is that there are different versions of packages involved.
Is there a way to make sure that symbols in the jars are always resolved using code in the jar itself or is there a better way to turn the jars into Maven dependencies?