War File Packaging Tips

Source: Internet
Author: User

1. First, tools such as Eclipse are handy.
2. Use tools such as WinRAR, the Web-info directory, and all its peers and all the directories and files, packaged into a zip file, and then changed the extension to war!
3 jar Command:
Suppose you have a Web application: C:/myhome
myhome/web-inf/...
Myhome/files/...
myhome/image/...
myhome/src/...
myhome/index.jsp
Execute the following command in the Command line window:
C:/>CD MyHome
C:/myhome/>jar CVF Myhome.war * *.
Explanation: Jar CVF [a=] War package name].war [b= resource files and folders] [c=] will generate the target folder for the war package]
"*/" (b=) represents all files and folders under the current directory (C:/myhome).
"." (c=) indicates that a war package will be generated in the current directory.
Once the operation is complete, you can deploy the resulting war package. For example, use the Tomcat container: Find the newly generated Myhome.war under C:/myhome, copy it into tomcat_home/webapps/, and start Tomcat.
Attached: jar command usage: jar {ctxui}[vfm0me] [jar-file] [manifest-file] [entry-point] [-c dir] files ...
Options include:

-C Create a new archive file
-t lists the archive directory
-X Unzip the archived specified (or all) files
-U Update existing archive file
-V generates verbose output in standard output
-f Specifies the archive file name
-M contains inventory information from the specified manifest file
-E is a standalone application bundled into an executable jar file
Specify the application entry point
0 store only; do not use any ZIP compression
-M does not create an entry for the manifest file
-I generate index information for the specified jar file
-C changes to the specified directory and contains the files therein
If there is any catalog file, it is recursively processed.
The specified order of the manifest file name, archive file name, and portal name
Is the same as the specified order for the "M", "F", and "E" flags.
Example 1: Archive two class files into an archive named Classes.jar:
Jar CVF Classes.jar Foo.class bar.class
Example 2: Use the existing manifest file "Mymanifest" and
Archive all files in the foo/directory to "Classes.jar":
Jar CVFM Classes.jar mymanifest-c foo/.

War File Packaging Tips

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.