Nexus 2, download latest artifact if not already installed

As said in the title, I would like to setup a command/script that gets the latest artifact (latest version) from a nexus 2 repository but only if the artifact version is different from the one already installed on my linux server.

If someone has a solution or documentation I would be very greatfull.

Thanks in advance,