Is there a way to know how many times my jar (in public Maven repository) is downloaded through Maven?
Asked Answered
M

2

10

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?

Meanwhile answered 27/4, 2010 at 6:19 Comment(2)
You wouldn't get perfect stats though. If an enterprise is using Nexus or Artifactory to serve their users, they should only hit central once and then cache the artifacts. So it's a bit imperfect is it not?Demos
I agree with you, but it's something isn't? Having no clue about any metrics on any released version is not the way to fix that.Backhanded
D
11

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?

Demaggio answered 27/4, 2010 at 7:16 Comment(0)
E
1

You can get the downloads count from nexus repo:

  1. Login
  2. Go to central statistics
  3. 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.

Reference SS

Engraft answered 3/2 at 6:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.