As you all know we require a application server to run a web app but what if you are delivering to a client who does not have any knowledge to setting up servers & deploying applications & from your (vendor) prospective, you do not want to get into all mess again & again for different clients (Setting up again & again).
Best way to get rid of setting up again & again is to embed application server within web app & deliver as JAR file to client. Client just have to run the jar or make it executable.
Follow the below process to achieve the target
- Create a maven project (web app) with packaging as WAR.
- Do what ever you want to design or display in your webapp (should have Web.xml :) )
- Modify the pom to create a jar file with war file. Include the shown plugin in
Note above plugin itself embed Tomcat version 7.0.30. Please do not use version 2.2 of plugin as it has some defects & jar won’t work. Also this plugin does not work with Tomcat 8 but i am looking into reasons & solutions. May be version 2.3 of plugin accepts Tomcat 8.
Now run the jar as
this will start the application & you can access the web app through browser
Dimit Chadha TOMCAT