nasir
nasir

Reputation: 137

Can we deploy the spring-boot jar inside the tomcat server?

I'm a bit new to spring boot environment and doing an poc on it. I know it might sound strange but i have this question like whether an spring-boot jar can be deployed in an tomcat server. The reason i'm asking this is that i read somewhere that spring-boot jar will come with embedded tomcat and also the .class files will be stored in different path compared to normal jars. So now if i deploy this jar in an tomcat server will it work same or do we need to do some extra configurations to make it work ?

Upvotes: 1

Views: 6452

Answers (1)

Sariq Shaikh
Sariq Shaikh

Reputation: 1124

You can not deploy Jar to tomcat and expect it to load your web application. War has its own directory and file structure defined which is read by tomcat and load the application accordingly. It can not understand jar file as web application and run it.

Now spring boot jar uses totally different approach to start the embedded server and load your application. It is not same as war deployed on tomcat but spring boot takes care of handling embedded server to serve the request.

If you want to deploy your spring-boot app as war, you can do that by changing few things in your project mentioned here.

Upvotes: 3

Related Questions