made with Findka

tools.deps bug with :local/root?

24 May 2019

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](https://clojure.org/guides/deps_and_cli) 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.

There's more where that came from if you subscribe to my newsletter.