Write a plugin to download statistics directly on the Nexus Repository Manager

I want to develop a plugin for Nexus repository manager. This plugin will display a “Download statistics” button on the UI.
Based on the user rights, it will create an Excel file (or/and others formats) with the usages and statistics of the differents repositories of the user.

Firstly, is it possible to develop a plugin/bundle wich add an action on the UI?

I’m new on Nexus development, I read the various documentations but do you have any examples and advices you can tell me on this?

Thanks you in advance.

You can add entries to the navigation (the left sidebar), e.g. nexus-public/UploadComponent.js at 4caccd14e094a7325bd57f7389045c9462a95911 · sonatype/nexus-public · GitHub

An example of a plugin contributing to the UI generally is the onboarding plugin -

Alternatively you could develop a UI plugin with React. This is a relatively new way to work on the frontend so we don’t have any public documentation yet. You can look at the nexus-coreui-plugin to see how we’re contributing React code to the frontend. In particular the index.js file adds new items to the left-hand navigation. nexus-public/index.js at master · sonatype/nexus-public · GitHub

1 Like

Thank you ! I’m checking this. It’s gonna take me a while to figure out how this works.
Is there a way to launch nexus-public in debug mode ?
Actually I built it and run “nexus console” but if possible, I want to debug the code step by step.

For the UI if running locally - http://localhost:8081/?debug

Oh to note we’re also slowing switching to react, there are some examples in the public code you could look at those too if you prefer.

For Java using KARAF_DEBUG=true and starting nexus should allow you to attach a debugger.

1 Like

http://localhost:8081/?debug is working to debug the UI.

For the Java code, usage of KARAF_DEBUG environement variable is not working for me.
I found a way by launching “nexus console debug” command to start Nexus.

I will see to use React for all UI interractions of my code.