This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-11
Channels
- # announcements (2)
- # beginners (30)
- # biff (6)
- # calva (4)
- # cider (4)
- # clj-yaml (3)
- # clojure (14)
- # clojure-europe (43)
- # clojure-nl (8)
- # clojure-norway (34)
- # clojure-uk (2)
- # clojurescript (11)
- # clr (2)
- # conjure (3)
- # cursive (1)
- # datomic (18)
- # helix (1)
- # humbleui (6)
- # hyperfiddle (110)
- # java (25)
- # kaocha (2)
- # lsp (29)
- # missionary (7)
- # off-topic (9)
- # pathom (106)
- # polylith (27)
- # rdf (12)
- # re-frame (9)
- # releases (4)
- # spacemacs (2)
- # tools-build (4)
- # tools-deps (6)
I still have one problem since switching to polylith, one namespace (test-utils) is not loading, any idea on how to debug this? The repl just says Namespace not found
. I am starting my repl like this: clj -M:dev:test:build:repl/portal
and when I run clj -A:test:dev -Spath
I can see it has the test-folder in there and poly ws out
also shows the namespace...
fortunately I can manually load the namespace and work with it but it's not convenient
(and yes, its namespace is test-utils
but the file has an underscore)
#error {
:cause "Could not locate de/yobst/yobst_core/test_utils__init.class, de/yobst/yobst_core/test_utils.clj or de/yobst/yobst_core/test_utils.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name."
:via
[{:type java.io.FileNotFoundException
:message "Could not locate de/yobst/yobst_core/test_utils__init.class, de/yobst/yobst_core/test_utils.clj or de/yobst/yobst_core/test_utils.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name."
:at [clojure.lang.RT load "RT.java" 462]}]
another odd behaviour is that I can load the test-utils
-ns once in the repl but the second time it tells me Namespace not found ...
What IDE are you using?
I'm going on a trip today and will be quite busy this coming week, so hopefully someone in the community can help you with this, or @U2BDZ9JG3 if he has time.
Which poly command is giving this error?
it's not the poly tool that gives the error. when I started a repl I get an error on loading my namespaces
it does not find the test-util
namespace and I don't know how to get rid of this problem. as written above poly ws out
shows the namespace is there and clj -A:test:dev -Spath
also shows the classpath with the test-directory
Maybe you can createa small repo where you reproduce the problem and share it here?
just one more question that might be quick to answer. where would you put a logback.xml? I guess in the project, so one for development and one for production, right?
projects/<name>/resources/logback.xml
-- matches what we do with log4j2.properties
for all our projects. And the dev/repl one goes in development/resources/
and make sure that in on your :dev
> :extra-paths
i assume they are going into the project right? with a test-alias and a test-resources directory, right?
We use a JVM property during testing to specify a test-only log4j2.properties
file, as I recall. But you could try something with a :test
alias in projects/<name>/deps.edn
for that -- I think you'd end up with both the production version and the test version on your path unless you use a test-specific name for the file?
-Dlog4j2.configurationFile=/var/www/worldsingles/development/resources/log4j2-silent.properties
-- since we know every env will always have that path (dev/test/CI/QA/production)
@U04V70XH6 and how do you use conditional rendering in .properties? Because you can use arbiters in xml, but this is not supported in .properties, so I'm wondering what's a good way to run something based on env there?
We haven't found the need for that. An env var can specify which .properties
file to use (and can be overridden by JVM opts) and that's been enough for us.
And are you building whole .properties file from scratch, or are you using multiple files during run (e.g. with configurationFile)?
I'm not sure what you're asking... we have three static properties files: one for dev, one for test, one for deployment.
We originally wrote them "from scratch" I guess but they rarely change now. Occasionally we need to add a new library's config to set a default level.