Welcome to the Ranch!
When using Maven, you only need to have a
provided dependency for the
servlet API. For "regular" applications that's either
javax.servlet:javax.servlet-api or
jakarta.servlet:jakarta.servlet-api. Which one depends on the server and version; only the more recent versions will use the Jakarta variant. You just use the API, and because the dependency is provided it won't be bundled with your application. Instead, the servlet container (
Tomcat, Jetty,
JBoss, etc.) will provide the implementation.
Spring Boot and Quarkus are different though. With these you don't build an application that's deployed in a servlet container. Instead, the bundled application comes with an embedded container that provides the implementation. I think they currently use Tomcat and/or Undertow.
With Spring Boot you don't include the servlet API as a dependency yourself. Instead, you use a starter. I like to use
https://start.spring.io/ to find the starters. For web applications, that's
org.springframework.boot:spring-boot-starter-web. That comes with the embedded Tomcat container I mentioned. It also provides the servlet API dependency for you.