I’m working on a plugin which I will use to track how the dependencies of my Gradle projects change. That is, I would like to be able to record (i) all dependencies for a given build, and (ii) all new dependencies downloaded for a given build. This includes JARs, the POMs associated with those JARs, and parent POMs. I have toyed around with, without success, to tell Gradle to download all new dependencies to a given directory. Therefore, all non-changed dependencies will come from the cache, and I have a directory containing new dependencies for further analysis. I’ve also tried learning of the new dependencies using the “artifact” and “configurations” API, but no luck.
It seems that the only way to do this is to generate the dependency graph and write to it file (does this also include parent POMs?). Then, I would need to write a custom parser and diff tool to determine when new dependencies have been added and extract them (Maven coordinates).
Is there a more obvious solution, or something more readily supported by Gradle or an existing plugin?