Skip to content

Instantly share code, notes, and snippets.

@jacobobryant jacobobryant/local-root.md
Last active May 24, 2019

Embed
What would you like to do?
tools.deps bug with :local/root?

On a project I'm working on, this gives me an error:

$ clj -Sdeps '{:deps {trident/build {:local/root "/home/arch/dev/trident/target/build"}}}' \
>     -m trident.build reset
Exception in thread "main" Syntax error compiling at (trident/build/util.clj:1:1).
...
Caused by: java.lang.ClassNotFoundException: jnr.posix.POSIXFactory
...

(I have (:import (jnr.posix POSIXFactory))) in that file).

It's fixed if I do either of the following:

  1. Change trident/build to trident-build
  2. Use a relative path for :local/root, e.g. {:local/root "target/build"}

The Deps and Cli Guide has two :local/root examples:

{:deps
 {time-lib {:local/root "/path/to/time-lib"}}}
{:deps
 {db/driver {:local/root "/path/to/db/driver.jar"}}}

The latter uses a slash (db/driver), and it's pointing to a jar. So most likely, the group/artifact syntax is only supposed to be used with jars, not unpackaged project directories. I don't know why using a relative path fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.