Unwanted jar files in tomcat / lib or WEB-INF / lib

I am currently working on an application that is about ten years old. When I looked at the jar files associated with the application, I can see many jars that are not required, and many different versions of the same jar.

What are the disadvantages of junk jars in lib. What is an easy way to find and remove them?

+5
source share
4 answers

You may have problems if the class loader decides to load classes from a different version of the jar file than you expect. Such problems are usually difficult to track. The server will browse the banks in a specific order (in alphabetical order by file name?) And use the first corresponding class / resource that it finds. There is probably no guarantee that the first version of the jar file looks first.

I do not know any tools that would know which banks are not used. This may not be possible in the general case due to reflection, but a certain degree of automatic verification should be possible, at least theoretically.

jar , , , . - , jar, .

+8

, , , . , , , jar . (, ).

, jar, JarAnalyzer. , jar. , . , .

, . , . Tomcat . , jar , .

+1

- jar , , ? , , .

, . tomcat ? , , , , , .

, .

0

, ?

QA. , , jars, , "" .

0

All Articles