How to suppress warnings when compiling Swoosh

During compilation, I get several warnings of this kind:

warning: Plug.Router.Utils.decode_path_info!/1 defined in application :plug is used by the current application but the current application does not depend on :plug. To fix this, you must do one of:

  1. If :plug is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :plug is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :plug, you may optionally skip this warning by adding [xref: [exclude: [Plug.Router.Utils]]] to your "def project" in mix.exs

which are not suppressed by placing xref: [exclude: [Plug.Router, Plug.Router.Utils]] in the project/0 function of mix.ex. It’s also useless to add :plug to the extra_applications.

What should I do?

I’m using Phoenix with Bandit instead of Cowboy, and so I removed plug_cowboy, which is what Swoosh expects. Restoring {:plug_cowboy, "~> 2.5"} in the deps solves the issue.