Up to coursier 1.0.0-RC12, setting COURSIER_CACHE=foo makes files land
in e.g. foo/https/repo1.maven.org/….
https://github.com/coursier/coursier/pull/676 changed that to foo/v1/https/….
This commit reverts things back to what they were before that.
In the long term, it would be better to keep the v1 component there, but
I'd prefer not to change that behavior right now.
Ideally, the scripted tests should still be run with sbt 1.0.1 too, to
ensure there are no regression with it, but the current setup doesn't
make that easy.
This cleans up the home directories of users and helps making sure that
Coursier's cache is not accidentically backed up by applications or OS
functionality.
The precedence is as follows:
- existing $COURSIER_CACHE environment variable
- existing coursier.cache Java property
- existing operating system specific standards:
- Linux: $XDG_CACHE_HOME/coursier, with fallback to ~/.cache/coursier
- Windows: {SpecialFolder.LocalApplicationData}/cache/Coursier
- macOS: $HOME/Library/Caches/Coursier
- existing ~/.coursier/
- fallback to operating system specific standard directory else.
See discussion in https://github.com/coursier/coursier/pull/676#issuecomment-338974822
Seems to fix java.lang.IncompatibleClassChangeError errors when using
shaded code. Release of coursier using the next one for shading should
be fine with Java 9 thanks to that.
* Update homebrew installation command
The command to install via homebrew didn't work for me. Presumably this changed in a recent version of homebrew.
This is the error I received:
```
$ brew install coursier/formulas/coursier
Error: coursier/formulas/coursier is a head-only formula
Install with `brew install --HEAD coursier/formulas/coursier`
```
So this change just incorporates the fix it suggests, which works for me.
* Fix other brew command, and report things to doc/README.md
If sbt-coursier is enabled in `project/project/plugins.sbt`, then one
can just add `addSbtCoursier` in `project/plugins.sbt` instead of
`addSbtPlugin(…)`. In particular, that allow to specify the version of
coursier only once.
These sometimes have POMs without the corresponding JARs for some
dependencies, which coursier doesn't allow for now (if a repo has
POMs, it must the corresponding JARs).
Plus preloaded stuff aren't that useful with sbt-coursier enabled.