JAR vs WAR file specification

前端 未结 4 1484
我寻月下人不归
我寻月下人不归 2020-12-21 08:57

I noticed that WAR files are supposed to have classes/ and lib/ directories for containing their classfile root and dependencies, respectively.

4条回答
  •  再見小時候
    2020-12-21 10:00

    They are containers with different purposes.

    • Jar is intended for Java class files and resources and can be a library or a directly runnable application.

    • War is a container to package complete Web applications including all dependencies (such as Jar files and other web resources).

    The question boils down to, why can't a jar include other jars. This I would take as a design decision taken to allow maximum flexibility in interchanging dependencies.

提交回复
热议问题