The artifact is packaged as a war so it can be deployed to Tomcat, but + * {@code spring-boot-maven-plugin} still repackages it as executable — the + * provided-scope container lands in {@code WEB-INF/lib-provided}, which the + * launcher puts on the classpath. So {@code java -jar udyamlinc-backend.war} + * and dropping the same file into {@code webapps/} are both supported, from + * one build. + * + *
Tomcat 11 or newer. Spring Boot 4 is built on Jakarta EE 11 and + * Servlet 6.1. Tomcat 9 is {@code javax.*} and cannot load this at all; + * Tomcat 10 is short of the servlet level. Running the war directly embeds + * Tomcat 11 and sidesteps the question entirely, which is why that remains + * the recommendation. + * + *
The context path moves. {@code server.servlet.context-path} is + * ignored under a container — the deployed file name decides it. Tomcat reads + * {@code #} as a path separator, so the war must be deployed as + * {@code api#v1#udyam.war} to serve {@code /api/v1/udyam}. Deployed under any + * other name every endpoint moves and the UI's relative API base misses. + */ + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { + return builder.sources(UdyamLincApplication.class); + } }