In my maven repository under groupId javax.servlet
i have these two separate artifacts for servlets. I am confused which one should i use to build a simple serv
If you have to deploy on an ancient application server version that doesn't support the servlet 3.0 spec (hopefully unlikely), stick with the old servlet-api.
With the 3.0 spec, they moved it over to javax.servlet-api. See: https://javaee.github.io/servlet-spec/
Now, with the move of Java EE from Oracle to the Eclipse Foundation (Jakarta EE), the spec has again moved. If at all possible you may want to consider using the new group and artifact if you want to stay up-to-date: jakarta.servlet:jakarta.servlet-api
https://github.com/eclipse-ee4j/servlet-api