I want my project to be launched on my personal computer via the Main function (either via java -jar
or by mvn spring-boot: run
), and when the development is complete, I can deploy it directly to Tomcat.
How to configure, to do this
Asked
Active
Viewed 75 times
0

netyjq
- 23
- 5
-
the answer I really want is here: [One Spring Boot project, deploy to both JAR or WAR](https://stackoverflow.com/a/25102040/8251835) – netyjq Jul 14 '17 at 13:28
1 Answers
1
You don't have to do anything special. Just follow the official documentation to build a deployable war. The war file created using the Spring Boot build process is executable as a regular jar file as it contains an embedded servlet container in a separate directory called lib-provided
which is added to the classpath only when the war is directly executed.
Bonus: If you want to get rid of unnecessary dependencies on embedded server when creating a deployable war, you can check out a blog post, which show how to do it step-by-step.

Daniel Olszewski
- 13,995
- 6
- 58
- 65
-
Thank you. You helped me learn more, but the answer I really want is here: [One Spring Boot project, deploy to both JAR or WAR](https://stackoverflow.com/a/25102040/8251835)@Daniel Olszewski – netyjq Jul 14 '17 at 13:26