A war file is a Web application that creates a war file that compresses the entire Web application (excluding the root directory of the Web application hierarchy) and specifies a. war extension. Jar is an archive of classes
A jar is a class collection that does not require a main function entry, and the war is a package of Web projects, not just a collection of classes, but a Tomcat container, a configuration file such as Web. XML, and a foreground page file.
The project compilation phase depends on the jar already has the main does not have the test rate entrance, directly uses this class to instantiate is possible, The jar that the project is compiled on must wait until the tomcat deployed by the war resolves the war's configuration to be indirectly dependent on the specific class through Tomcat.
Next you need to verify that if the war is deployed to the Tomcat to stop, there is no error phenomenon, what is the phenomenon? What does maven do to make it feel like a war without Tomcat can be used directly? These two questions are important!
The difference between jar and war