The difference between jar and war

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.