For statistical reasons, we need to know how often our library (jar) is used. When users download the jar from our website, we have a built-in script that counts the downloads. We have recently also included the jar in the Maven public repository. Is there a way to get statistics on how often the jar is actually downloaded through Maven?
When you run a Maven build, then Maven automatically downloads all the dependency jars into the local repository. It helps to avoid references to dependencies stored on remote machine every time a project is build.
Public repositories store software artifacts that are free for the entire world to download. Maven and other build tools connect to public repositories to download dependencies used in software projects. Dependencies are downloaded to the local maven repository, which defaults to the ~/.
the local repository is a directory on the computer where Maven runs. It caches remote downloads and contains temporary build artifacts that you have not yet released.
Maven Central, a.k.a. the Central Repository, is the default repository for Maven, SBT, Leiningen, and many other JVM based build tools. It has been around since 2002, and serves many terabytes of assets every year. Maven Central also has a search site.
You're not alone, see MNG-3615. But as explained in the same issue, this is not part of Maven's job. In other words, apart from using grep
and wc
on a (possibly) aggregated access.log
(yeah, mirrors) of the central repository, I don't see how you could get a count (and obviously, not anybody can do this).
Funnily, Jazon Van Zyl also blogged about this in Nexus: Improving Maven Central and Supporting the Maven Ecosystem a few months ago:
Next we’re thinking about ways to make statistics for a given project’s artifacts available to the project’s developers. We have already implemented user signup in Nexus and we are currently working on project signup as well. What this means is that projects can register with a given groupId, or set of groupIds, and optionally be provisioned a repository which can be operated by a set of users. Once a project registers we will know what slice, or slices, of the statistics they need to see. Our initial thought is that project statistics, number of downloads should only be made available to the public with the permission of each individual project. Brian and I along with Greg Luck and Dain Sundstrom have been working on a simple statistics mechanism that we hopefully can provide to projects early this year.
Why not leaving a comment to get some update?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With