Before that commit, sources / javadoc were put under the "compile"
config when running "publishLocal". This commit puts them under the
"sources" and "docs" configs.
If the POM is in cache, but not the directory listing (nor a .error file for it), the LocalUpdate and LocalUpdateChanging policies make MavenRepository do as if the directory listing is missing - it is not even checked with the subsequent cache policies if any (because the POM was found with LocalUpdate / LocalUpdateChanging in the first place).
This PR fixes that - getting the POM will fail if the directory listing or an error file for it is missing from cache. That way, subsequent cache policies can fetch the directory listing.
As this only happens depending on what's in cache, it's a bit cumbersome to test as is. Relying fully on NIO2 in subsequent coursier versions should make it easier to add test cases for that (by using a virtual fs like jimfs to test what happens depending on what's in cache).
The test should basically do:
$ coursier fetch org.apache.maven:apache-maven:3.3.9 # fill cache
$ rm -f $CACHE_PATH/https/repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/.directory
$ rm -f $CACHE_PATH/https/repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/..directory.checked
$ coursier fetch org.apache.maven:apache-maven:3.3.9
The second fetch should work fine, fetching the directory listing, seeing that it lists no JAR, and then not attempting to download one. Before this commit, the second attempt would assume that the directory listing is not available, do without it, so assume that a JAR exists, and fail to download it.
Have it ~extends "default" rather than "compile", so that depending on both "default" and "optional" can be simplified to just "optional" ("default" being pulled by it now, thanks to this change). That allows to address the scala-compiler jar appearing twice on the classpath sometimes.
This commit adds support for a `bintray-ivy:` repository prefix to the `--repository`
flag in the cli. This option is equivalent to the `Resolver.bintrayIvyRepo` helper in sbt.
With this new helper, it's possible to write `-r bintray-ivy:scalameta/maven/` instead of
```
-r ivy:https://dl.bintray.com/scalameta/maven/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
```