Is there an Ant task which can fetch an artifact from Hudson/Jenkins?
I've hand-rolled my project's build-system (mostly in Python + Hudson). One of the things I need to do quite often is fetch artifacts from upstream Hudson / Jenkins.
These artifacts could be almost anything - for example a zip-file full of business data to process or even an egg containing a load of python code which must be tested. Almost every important job in our system has upstream dependancies on artifacts produced by other Hudson jobs.
My manager has suggested that the next iteration of the build-system should replace some of my hand-rolled components with Ant. The purpose of this next iteration will be to reduce the complexity of our systems and bring them into line with the work of other teams who mainly use Java and Ant (and very little Python).
Also I'm personally keen to have an excuse to learn Ant. It seems like a really useful tool.
So in order not to re-invent the wheel one component I'm definitely going to need is an Ant task which can fetch an artifact from a particular Hudson build. Does such a thing exist. If it does not exist, is there something close to my requirement that I could c开发者_如何学Customize? I'd rather not re-invent the wheel.
UPDATE1: We have a strong preference for 100% free, open-source tools. Everybody in the team is very happy with Ant, however Maven is something the team is trying to get away from.
The proper solution is to publish the artifacts from Hudson/Jenkins to an artifact manager, such as Nexus or Artifactory, and then pull the artifact versions with something like Ivy or Gradle.
If you must get the dependencies yourself, you could use the get
task. Example:
<get src="http://jenkins/job/project-name/lastSuccessfulBuild/artifact/foo.jar"
dest="/path/to/local/file"/>
I do, however, agree with Stefan - dependency management is better accomplished by tools mentioned in his answer instead of manually pulling them down yourself using Ant.
If you are just starting to learn ANT then I would suggest you learn gradle instead, it has the dependency part already integrated and is far easier to work with. Furthermore if you need a specific ANT task you can simply call it from gradle or even import whole ant scripts.
Otherwise I agree with the answer from Stefan Kendall.
精彩评论