I am trying to use pedestal in a Polylith base.
(ns ns.optservice.apipdstl.core
(:require [io.pedestal.http :as http]
[io.pedestal.http.route :as route]
[clojure.data.json :as json]
))
Eval returns (cheshire/core.clj:1:1). ; namespace 'cheshire.factory' not found
Deps.end for this base has
:deps {io.pedestal/pedestal.jetty {:mvn/version "0.6.1"}
I also added do the deps cheshire/cheshire {:mvn/version "5.11.0"},
But it does not help. Something I don’t fully grasp from the docks is where to add the dependencies for bricks
Is this the right place for this dependency? Or shall in be added to the root deps.end to deps? Or :dev -> :extra-deps?Library dependencies for bricks go in each brick's deps.edn as regular :deps.
If you add dependencies, you need to restart your REPL (or use sync-deps in Clojure 1.12) to pick up those changes.
And make sure you start your REPL at the top-level -- which may depend your editor/plugin combo.
Figured it out. If I start the REPL for the base directly, no error is thrown. However, starting with the root :dev profile deps.edn (what you called the top-level) results in an error. It appears there’s a dependency conflict: com.fasterxml.jackson.core/jackson-core version 2.5.2 is set in the :dev profile, while Cheshire requires a different version of Jackson Core. It wasn’t obvious that Pedestal uses Cheshire and Jackson, but Copilot helped to figure it out!
Note to myself: don’t carry over dependencies and remove all irrelevant ones not required by a component