Hello world web application with Maven + Java + Servlets + Tomcat
mvn clean install
The compiled file will been stored in target
folder as hello.war
mvn tomcat7:run
The servlet can be executed in browser by path http://localhost:8081/hello
After compile app just run next
docker run -i --rm --name hello-app -p 8081:8080 \
-v ${PWD}/target/hello.war:/usr/local/tomcat/webapps/hello.war \
tomcat:9.0-jre8-alpine
And for opening the Servlet run in browser http://localhost:8081/hello/hello