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?
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?
You can get the downloads count from nexus repo:
- Login
- Go to central statistics
- Select your group id and artifact id and you will see that.
Not sure if we can get the API for getting downloads count. But you can see your stats over there.
© 2022 - 2024 — McMap. All rights reserved.