When running your application locally
at the REPL, you will want to
have your choice of servlet container running inside your JVM, and so the
servlet container, and the Pedestal adaptor for the container, will be a dependency
of your project.
In this mode, you are running the servlet container embedded within your application; you application
starts and, as part of that, starts the servlet container.
For example, if you are using Jetty, then you’ll want the io.pedestal/pedestal.jetty
library.
This is a perfectly fine way to run your applications in production, but since you are reading
this page, you are interested in deploying as a WAR instead, and the rules are slightly different.
By contrast, a WAR file should not contain dependencies on the servlet container.
At runtime, the servlet container starts up, then creates a new class loader to load your WAR.
Having the servlet container’s classes present in the WAR will create deployment conflicts.
A WAR file contains all the dependencies of your application, but it
should not contain any dependencies which would conflict with the
web container itself.
You should ensure that your application only depends on the io.pedestal/pedestal.service
library; the dependency on a container (such as pedestal.jetty
) should be in a dev-only or test-only path.