Last Updated: October 20, 2022
Steps:
- 1.Open Maven project.
-

Figure 1. Maven Prjoect.
- 2.Run project as build. as shown in Figure 2.
-
Right-click → Run As → Maven Build.

Figure 2. Build screen.
Wait until the build finishes.
- 3.Navigate to project location then go to the target file. as shown in Figure 3.
-

Figure 3. Target file.
- 4.Copy the war file. as shown in Figure 4.
-

Figure 4. Target file.
- 5.Paste it in webApps file. as shown in Figure 5.
-
go to /var/libtomcat9/webapps

Figure 5. WebApps file.
After pasting the war file, a file will automatically be created with the same name of the war file. as shown in Figure 6.

Figure 6. WebApps file.
- 6.Run tomcat with the terminal. as shown in Figure 7.
-
To start tomcat use the following command :
sudo service tomcat9 start

Figure 7. Starting tomcate.
- 7.Go to URL localhost:8080:/app. as shown in Figure 8.
-
8080 is the default port for tomcat. |

Figure 8. WebApp running on chrome.
Now your WebApp is running on tomcat Enjoy.