0

I have about 30-40 Jars that are being used by my application. Since the application is old and many have worked on it before me, therefore i want to figure out, if there has been any customization on them or not.

currently i am trying to find all the jars from the available versions and then downloading them. then i am planning to run a diff-merge on them to find out the difference.

I think there should be an alternative way to this. please tell. some can be found out just by looking at the JAR name or Manifest File. but what about others?

please help.

Fr_nkenstien
  • 1,923
  • 7
  • 33
  • 66

2 Answers2

2

You could calculate a hash code such as MD5. If both jars have the same MD5 hash code, it's very likely the content is the same as well.

Otherwise if you have a good test coverage you could go for a try and error approach:

  • Mavenize your project
  • Run the tests
Puce
  • 37,247
  • 13
  • 80
  • 152
  • please suggest any tool for calculating the hash code and if possible some link to the download site as well. thanks in advance – Fr_nkenstien May 18 '12 at 09:37
  • 1
    On most unices (including linux) it is already there. Use `md5sum `. For Windows it shouldn't be to hard to open google yourself... – Axel May 18 '12 at 09:43
  • 2
    @VineetVerma I did the googling for you. http://www.google.co.in/search?q=tool+for+calculating+the+hash+code&sourceid=ie7&rls=com.microsoft:en-us:IE-SearchBox&ie=&oe=&redir_esc=&ei=2Bm2T-SZGYWw6AH_u4D5Cg – Abhilash May 18 '12 at 09:44
0

The easiest way I can think of obtaining a set of dependencies would be to create a new Maven project and add each of the jars you require to the project pom file.

Maven, if you're not aware is a Java build tool that focuses on making dependency management easy. It does so through a pom.xml file which lists information about your project including the list of jars (dependencies) that it requires. Dependencies are identified by their name (artifactId), group and version in the following XML format...

<dependency>
  <groupId>group-a</groupId>
  <artifactId>artifact-b</artifactId>
  <version>1.0</version>
</dependency>

You could create a new mvn project (download and install maven first) then execute:

mvn archetype:generate

To create a new project. This will provide you with an empty project with no dependencies and a template pom.xml file. From there you can edit your dependency list and add each of the 40 jars you require. Once you've done that execute ...

mvn dependency:copy-dependencies

This will pull all of the jar files you require from the Maven online central repoistory into your project's target/dependency folder. From there you can write a script to perform the md5sum comparison of your jar files.

Find out more about Maven at the official homepage.

mmccomb
  • 13,516
  • 5
  • 39
  • 46