I need a way to use HTTPBuilder in Groovy/Java with a url to tell if an artifact is in a Nexus 3 repository or not. Maven is not available.
<p>This maven2 hosted repository is not directly browsable at this URL.</p>
Sample code might be
String url = 'http://nexus.company.com:8081/nexus/repository/myrepo/com/company/sample-app/1.0.1/sample-app-1.0.1.war'
new HTTPBuilder(url).get(path: '') { response ->
return response.statusLine.statusCode == 404
}
Whether it's there or not, this will give me a 200 with a text/html response.
Bonus points for how to do it without actually downloading the artifact if it's there.