I am trying to deploy a spring boot app on a tomcat server. I have this dependency in my pom.xml file:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
When checking the logs of the server (catalina.out) it says:
Deployment of web application archive [/home/username/apache-tomcat-8.5.57/webapps/myapp.war] has finished in [4,501] ms
and as a result of the .war file being in the /webapps directory, the directory webapps/myapp is created. However, when I try to access the service, I get a 404 error stating that "The requested resource is not available". I have tried from the front-end angular app, postman, and simple get request directly from the browser. The logs of spring never appear in the logs of tomcat.
The .war file is built using the following command:
mvn clean package -Pprod
NOTE: On the same tomcat server, there is an angular app which is running just fine. The server has been used before and has worked with the current configurations. I believe it has something to do with the way I am deploying (?)
I finally found what was wrong. Because the project was initially created by some colleague, the pom.xml file was one level above where its meant to be. I have no clue why they did that and how they have been working and deploying fine with that. Moving pom.xml to the directory it's meant to be solved the problem.
EDIT: What's also funny about this is that running the project locally with the embedded tomcat server of spring boot didn't cause this issue.