I have a maven project that uses spring data jpa and hibernate (Services, Entities, Repositories, ...). Everything is compiled to a jar file with AspectJ.
Now I wanted to add a REST API in order to receive POST/GET messages. So I added spring boot and spring web to add RequestMappings ans Controller to my project.
The problem is, that I can not modify the main(String[] args)
method of the project so I can not add the Spring boot context in order to use the build in Tomcat.
Because of that I am wondering if I could use a tomcat that is installed on the machine where my jar file will be executed.
The only way that I found on StackOverflow is to compile a war and deploy it on the Tomcat. But I am very limited in my project architecture. So the fact that I have a jar file that must be located in a specific folder and also my restriction not to modify the main(String[] args)
method is a little bit annoying. So can I somehow tell spring to use the existing tomcat and listen to the incoming connections? Or is there an other way to get a working REST API to this kind of project structure?