I have two Java projects managed with different dependency/delivery tools and wa
ID: 661349 • Letter: I
Question
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.
Explanation / Answer
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.