I am using Acive Choice Reactive Parameter plugin to list down Nexus Artifacts. This is the groovy script which I'm currently using.
import groovy.json.*
def targetUrl = "https://nexus.xxxx.lk/service/rest/v1/search?repository=snapshots&format=maven2&group=com.org.pro&name=pro-service"
def jsonSlupper = new JsonSlurper().parse(URI.create(targetUrl).toURL())
def list = jsonSlupper["items"]["version"].collect().sort().reverse()
I want to display only latest artifact in the list. Does anyone know, how to do this?