Create .war file




















Interesting, so you're that using "jar cvf my-app. Let me try that. SomeGuyOnAComputer well i havent tested the jar tool to be honest. But yes if you follow the WAR-directory layout and have a working webapplication inside that structure could be a single index. I tried the zip method and unfortunately that didn't work.

However the stackoverflow. Voicu Voicu With all these options: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy Francesco Marchioni Francesco Marchioni 3, 19 19 silver badges 36 36 bronze badges.

Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.

Linked Maven's homepage. Maven WAR plugin. A war file is simply a jar file with a war extension, but what makes it work is how the contents is actually structured. If you create a new web project in Eclipse I am referring to the Java EE version , the structure is created for you and you can also tell it where your Appserver is installed and it will deploy and start the application for you.

If you are not sure what to do and are starting from scratch then Maven can help get you started. As some others have said the downside of using maven is that you have to use the maven conventions.

But I think if you are just starting out, learning the conventions is a good idea before you start making your own. Use the Ant war task. This should create your war file and is the quickest method I know. You will need JDK 1. Another option would be to build it automatically using Eclipse.

Of course if you have continuous integration environment Ant or Maven is recommended. The export alternative is not very convenient because you have to configure every time the export properties.

Go and create a new archive in the "Project Archives" top dir. Configure Fileset-s, i. Typical is to configure two filesets similar how the Web Deployment Assembly project property is configured. You might need to tweek the fileset exclude property depending where you placed some of the config files or you might need more filesets, but the idea is that once you configured this you don't need to change it.

Build the archive manually or publish directly to server; but is also automatically built for you by Eclipse. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to create war files Ask Question. Asked 12 years, 7 months ago. Active 1 year, 6 months ago. Viewed k times. Add a comment. Active Oldest Votes. David Citron David Citron How should I change the targer?

Here, we will discuss what is war file, how to create war file, how to deploy war file and how to extract war file. It reduces the time duration for transferring file. So it takes less time while transferring file from client to server. To create war file, you need to use jar tool of JDK. You need to use -c switch of jar, to create the war file. Here, -c is used to create file, -v to generate the verbose output and -f to specify the arhive file name.

If you want to deploy the war file in apache tomcat server manually, go to the webapps directory of apache tomcat and paste the war file here. To extract the war file, you need to use -x switch of jar tool of JDK. Let's see the command to extract the war file. JavaTpoint offers too many high quality services. Mail us on [email protected] , to get more information about given services. Please mail your requirement at [email protected] Duration: 1 week to 2 week.

Servlet Tutorial. War File welcome-file-list Load on startup. Servlet Collaboration. RequestDispacher sendRedirect. Servlet Advance Session Tracking. Next Topic welcome-file-list in web.

Reinforcement Learning. R Programming.



0コメント

  • 1000 / 1000