At work, we have been using Nexus OSS 1.8.0 for a few years now. Recently, I (as a Nexus admin) have been asked how many artifacts are in our instance. It's a very simple question, but I can't for the life of me find an answer anywhere:
I provided a reasonable estimate of many artifacts we have, and that's good enough for now, but I had more work than I felt I should've had... Did anybody have the same problem?
Update:
I needed to know how many internal artifacts we have (as opposed to external dependencies from Maven Central and the like), so I ended up GET-ing:
http://<OUR-NEXUS>/service/local/lucene/search?q=*&repositoryId=<OUR-REPO>
for every hosted repository and adding up the totalCount fields.
For the full count, searching for q=* yielded too many results, so I ran:
find $PATH_TO_SONATYPE_HOME | grep sha1 | egrep -v 'nexus-maven-repository-index|repository-metadata|maven-metadata|\.pom\.sha1' | wc -l
But I'm still surprised this type of information isn't readily available...
Try the following:
find $PATH_TO_SONATYPE_HOME -name "*.jar" | wc -l
It will only count JAR artfacts but that normally accounts for the bulk of files stored in Nexus
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