开发者

Eclipse plugin for jar dependency detection and possible safe removal

开发者 https://www.devze.com 2023-04-04 02:45 出处:网络
I have a series of eclipse projects that use a bunch of third party jars. So many are included of different versions.

I have a series of eclipse projects that use a bunch of third party jars.

So many are included of different versions.

But I hav开发者_StackOverflow中文版e noticed that some of these libraries, due to code changes over the time, are not used any more but the reference to the library is there.

Is there any plugin that shows the jar dependencies of each project and which I can remove safely?


JarAnalyzer can be used for this purpose.


I am not aware of any plugin or tool that helps in doing what you want to do. However, there may be rules or procedures that help to reach the final end: a reduced set of libraries that is needed and consistent.

  • I have found the the "Java API Compliance Checker" which allows to compare two versions of the same library. May help to reduce the number of the used libraries for the same purpose. I have not used it, so I cannot tell you about my experience.
  • Define if it is allowed to have the same kind of library in different version available. Depending on the environment, this may or may not allowed.
  • Incremental process to reduce the amount of libraries needed:

    1. Remove one library each time from eclipse.
    2. Look if compile errors result from that.
    3. If yes resolve the compile errors.
    4. When all are resolved, start your unit tests (you have unit tests, of course :-)) and see if any unit test breaks.

    Do these steps for each library you want to remove.

At the end it could be worthwhile to look at a tool like ivy that allows you to manage the libraries explicitly. Or even switch to Maven which allows you the same.

Final remark: The usage of a library should be

  • decided by the architect of an application only and
  • documented in the architecture handbook together with the reasons for doing that.


Try open your Manifest file. You can edit and remove the dependency from there

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号