Question

I developing webservice application with IntelliJ IDEA, using Apache CXF, Spring, Hibernate and some more. All these framework are ship with a lot of libraries, but I do not use all of them.

At the moment I waste a lot of time to determine which jar files I have to deploy into the production enviroment to ensure a properly working system.

Is there an easy and fast way to determine which libraries, more precise which jar files are loaded/needed by my application.

Was it helpful?

Solution 2

Use Maven. It's the most popular dependency management tool in the Java world.

OTHER TIPS

Try Loosejar: http://code.google.com/p/loosejar/

For demo, I ran the Loosejar agent against a small applications in my eclipse workshop. The application uses 4 jars (jsoup-1.6.1.jar, httpclient-4.2.3.jar, httpcore-4.2.2.jar, commons-logging-1.1.1.jar). I added an unused jar file to the build path- “soap-2.3.1.jar” and started the application. Then opened jconsole and viewed the summary of LooseJarMBean(screen shot below). The results show the no of used classes from each jar. Unused jars will be shown with 0% utilization

enter image description here

Another way is to do it manually. In one of our projects we added jars manually to project until all compilation issues are resolved. This approach has a limitation where if a jar refers another jar then we will get to know about it only during run time.

Try Dependency Finder it might be able to list all your library dependecies.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top