wget
respects the robots.txt
file for recursive downloads. And that file prohibits everything (for no good reason AFAICT, as Build Now requires to be POST
ed in Jenkins, at least in recent versions).
Jenkins has an API. Several objects, including builds, have API endpoints. In this case, http://ci.onarandombox.com/job/Multiverse-Core/lastStableBuild/api/
.
You could query http://ci.onarandombox.com/job/Multiverse-Core/lastStableBuild/api/xml
or http://ci.onarandombox.com/job/Multiverse-Core/lastStableBuild/api/json
and parse the returned text for the artifacts
element. The tree
argument allows filtering, like e.g. in http://ci.onarandombox.com/job/Multiverse-Core/lastStableBuild/api/xml?tree=artifacts%5BrelativePath%5D
:
<freeStyleBuild> <artifact> <relativePath>target/Multiverse-Core-2.5-javadoc.jar</relativePath> </artifact> <artifact> <relativePath>target/Multiverse-Core-2.5-sources.jar</relativePath> </artifact> <artifact> <relativePath>target/Multiverse-Core-2.5.jar</relativePath> </artifact> </freeStyleBuild>
Alternatively, use XPath for more powerful filtering, but note that in a recent security update, some functionality (like text()
) was disabled. Example: http://ci.onarandombox.com/job/Multiverse-Core/lastStableBuild/api/xml?xpath=/freeStyleBuild/artifact/relativePath&wrapper=artifacts
From the command line, you can parse the XML e.g. using a recent version of xmllint
, or, in the Xpath example, just ignore the text and select the file names.