The "Spring Boot" 6.idea springboot is packaged into jar packages and war packages and can be run under external tomcat to access the

Source: Internet
Author: User

Then the last chapter goes: http://www.cnblogs.com/sxdcgaq8080/p/7712874.html

Package The Spring boot project created in the previous chapter into a jar package and a war package

"The difference between the jar and the war is that the value in the:<packaging> tag is changed to the line like"

=============================================================================================================== ======================

All right, here's the jar bag.

Using MAVEN's plug-in package

The package is now packaged with the default name of the jar package. Then run the jar package from the command line. Of course, the jar package name you need to go to the above target path to copy down. "Not very troublesome!!" 】

Then visit the JSP page, because I added the method of printing, you can see in the

However, the page cannot be accessed:

Then go to the jar package to see, because the jar package does not have the WebApp page file, etc., of course, the visit cannot find the page "If you want the jar package can also be packaged webapp under the page, you can: http://www.cnblogs.com/ Sxdcgaq8080/p/7715427.html "

Well, since the package is not successfully accessed, pack the war package: just change the jar to a war.

"Note: If you do not want to copy the jar name, the name of the package is customized, under build can be specified"

Packaged into a war package

See if the name of the packaged war package is customized.

Then run the war package again

This can be accessed.

Look at the war package, the page file has been packaged in.

=============================================================================================================== ========================

All right, pack up for a while, just take the above war bag and put it in an external tomcat. Try it:

The "Spring Boot" 6.idea springboot is packaged into jar packages and war packages and can be run under external tomcat to access the

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.