Can I download some files from http while maven lifecycle? any plugin?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the file is a Maven dependency, you could use the Maven Dependency Plugin which has a
getgoal.For any file, you could use the Antrun plugin to call Ant’s Get task.
Another option would be the maven-download-plugin, it has been precisely created to facilitate this kind of things. It’s not very actively developed and the documentation only mentions an
artifactgoal that does exactly the same thing asdependency:getbut.. If you look at the sources, you’ll see that is has a WGet mojo that will do the job.Use it like this in any POM:
Key benefits of this plugin are caching of the download and checking against a signature, such as MD5.
Note that this answer has been heavily updated to reflect changes in the plugin as noted in the comments.