In one of my Maven projects, dependency resolution will succeed once, then fail for later build attempts:
...and so on, until I delete the maven-metadata-local.xml files corresponding to the failing artifacts (e.g. ~/.m2/repository/commons-logging/commons-logging/maven-metadata-local.xml), which appear to be created by maven-invoker-plugin:install. After those files are deleted, the next mvn invocation proceeds properly; the metadata files are restored by that invocation (presumably as part of the process of checking my upstream repositories/mirrors for updated artifacts), and I am again presented with the above errors until I again delete the metadata files.
This is repeatable, even after starting with a completely fresh local repository. Note that Maven 2.2.1 does NOT exhibit this problem.
FYI, I'm not using an integration-testing-only local repo [http://maven.apache.org/plugins/maven-invoker-plugin/install-mojo.html#localRepositoryPath|as described here], simply because doing so causes the re-downloading of all transitive dependencies ([http://maven.apache.org/plugins/maven-invoker-plugin/examples/fast-use.html|unless you want to maintain an integration-specific settings.xml file!!!]). I've used the invoker plugin with a variety of other projects in this way with good results ([http://github.com/clojure/tools.nrepl|example]) – certainly never encountering a borked local repository in the process like this.
Here's an affected project: [https://github.com/cemerick/rummage/tree/1.3.0-compat|the 1.3.0-compat branch of rummage]. To reproduce, just clone that repo, checkout 1.3.0-compat, and:
Once the local repository is broken (by the generation of the maven-metadata-local.xml files, AFAICT), no builds will get past the dependency resolution stage.
Running mvn -X reveals lines like this for each artifact that is later apparently not found:
Of course, /Users/chas/.m2/repository/javax/mail/mail/1.4.4/mail-1.4.4.jar et al. does exist, as does /Users/chas/.m2/repository/javax/mail/mail/1.4.4/mail-1.4.4.pom.
I'm assuming this is a bug in Maven 3's core dependency resolution mechanisms (as opposed to maven-invoker-plugin) since Maven 2.2.1 doesn't exhibit the behaviour.