tomcat9java-17spring-boot-maven-pluginpostgresql-14

how to deploy the spring boot war on tomcat?


I am trying to make the war file of the spring boot application in vs code using this command mvn clean mvn clean install or mvn clean install or mvn package

when i am deploying the war on tomcat and check into the browser and hit this url http://localhost:8080/welcome but tomcat started and my welcome routes not working it gives me the error

pom.xml:

application.properties:

spring.datasource.url=jdbc:postgresql://localhost:5432/cghs2test

when i deploying the war on tomcat my controller not hit this is my controller


Solution

  • for building the tomcat war: tomcat9.x - spring boot 2.x dependecy tomcat pom.xml spring-boot-starter-data-jpa spring-boot-starter-web spring-boot-starter-tomcat tomcat-embed-core thymleaf(opt)