I have created a war file and put into tomcat/webapps
. How to deploy a war file to tomcat using command prompt?
Run the WAR file Open up a terminal/command prompt window to the download directory. Run the command java -jar jenkins. war . Browse to http://localhost:8080 and wait until the Unlock Jenkins page appears.
The earlier answers on this page are correct that you can copy/move the WAR file into place and restart tomcat, but they omit to mention something: you must remove the previously exploded assets (from the previously deployed WAR file) if any are present.
# My tomcat webapps are found at /var/lib/tomcat6/webapps # The application I wish to deploy is the main (ROOT) application webapps_dir=/var/lib/tomcat6/webapps # Remove existing assets (if any) rm -rf $webapps_dir/ROOT # Copy WAR file into place cp example_dir/ROOT.war $webapps_dir # Restart tomcat service tomcat6 restart
Modify the following for your own system:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With