http://publicip:8080/CounterWebApp/
To Manually Build and Deploy the application We require Maven and Tomcat9
sudo apt install openjdk-11-jdk
wget https://mirrors.estointernet.in/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar -xvf apache-maven-3.6.3-bin.tar.gz
sudo mv apache-maven-3.6.3 /opt/
M2_HOME='/opt/apache-maven-3.6.3'
PATH="$M2_HOME/bin:$PATH"
export PATH
sudo apt update
sudo apt install openjdk-11-jdk -y
sudo apt install tomcat9 tomcat9-admin -y
sudo ufw allow from any to any port 8080 proto tcp
sudo systemctl status tomcat9
Note: open port 8080 on the vm.
mvn clean install compile package
Note: Since we have not added the tomcat plugin in the pom.xml we have to manually place the war file in the /var/lib/tomcat9/webapp directory.
Copy the Artifact war file which is created in the target folder to Tomcat webapp directory
sudo cp target/CounterWebApp.war /var/lib/tomcat9/webapp/
sudo systemctl restart tomcat9