Skip to content

Instantly share code, notes, and snippets.

@jacobobryant
Last active May 24, 2019 22:01
Show Gist options
  • Save jacobobryant/5737ae4a399e37805d8264b4033e44dd to your computer and use it in GitHub Desktop.
Save jacobobryant/5737ae4a399e37805d8264b4033e44dd to your computer and use it in GitHub Desktop.
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