12

I have two Java projects managed with different dependency/delivery tools and want to know the differences of the required dependencies.

I am using Linux (CentOS) in a VM but a Windows solution can be acceptable.

The first project which is the original is based on Ant scripting and the dependencies are hardcoded somewhere there, all the needed libraries in a lib folder, and then a build.properties have a mapping alias=name-version.jar

The second project is a maven project based on the first one but we added and updated some dependencies.

My goal is to find a tool (if it exists) to make a report thats say something similar to this:

Project 2 - new dependencies:

  • Joda Time version 2.1
  • Google GSON version 3.2
  • Apache CXF 2.5
  • DWR version 3.2-beta

Project 2 - updated dependencies:

  • Apache commons lang from 1.2 to 1.6
  • Apache Commons IO from 2.1 to 2.4
  • slf4j From 2.4 to 2.6

Project 2 - removed dependencies

  • Log4j version 1.2
  • Castor version 2.1

Note: the version are not reflecting the reality, it is just to show an example.

3

Since nobody has recommended such a tool (in 3 months), I'm going to suggest an alternative approach using existing tools.

Step 1: extract the dependencies.

  • for the Any project, either ls the lib directory, or write a simple script to extract the list from the build.properties file.

  • for the Maven project, you can extract the list from the output of mvn dependency:list. (See this blog posting for an example.)

Step 2: sort the lists

Step 3: use the diff command to see the differences.

  • Let me add this package: tattletale.jboss.org -- it will look into every jar in your lib directory for detailed information. – Bob Dalgleish Aug 17 '14 at 11:54
  • Thanks, finally it was the 'manual' solution I applied. Thanks also to Linux bash utils which are quite more useful than the ones under Windows. (Sed and Awk are so powerful) – рüффп Nov 27 '15 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.