How to check the Nexus Repository Manager version from Linux command line?

How to check the Nexus Repository Manager version from Linux command line?
Thanks
-Pete

Hi Pete,
Currently the easiest way to get the version of Nexus 3 from the command line is to use curl and parse the ‘Server’ response header.

$ curl --include --silent http://localhost:8081/ | grep Server

Server : Nexus/3.12.0-01 (PRO)
3 Likes

Hey Pete,

What’s the use case for this?

As you can gather from @mworthington answer, we don’t have a super easy way to accomplish this, but I’m interested to hear what you’re looking to do.

Hi,

Thanks for the answer - I’ll try that…

I’m responsible of Our CI/CD delivery environments and there is quite a lot of different software running… I have created a healtcheck Jenkins/RobotFrameWork job which collects diffrent kind of information from all CI servers to one page - there I need this. I collect this information from all used SWs…

Thanks
-Pete

I also would like a way to retrieve the version number programmatically. This could be used to help tell if a REST API feature would be supported by the server (based on the Nexus OSS version).

I currently cannot use the suggestion from @mworthington because my nginx reverse proxy seems to be replacing the Response Header server field with nginx/1.2.0. Maybe there is a way to overcome this issue with a configuration change on the nginx side, but I think it would still be good if the REST API allowed for a place to GET Nexus server information such as the version.

Hello,

While this is an old thread, I’m also looking for answers and found one: this is through swagger.

curl -s http://localhost:8081/nexus3/service/rest/swagger.json|jq -r '.info.version'

Hope this helps.