问题
Is it possible "and how if you know", to schedule the execution of an ant task? For example, i want my build.xml to be executed every 5 hours or every day at a certain time? I have been looking around but no solution found
Thank you
回答1:
For very simple requirements, I'd echo the use of cron.
If the reason for running ANT is to periodically perform a master build of your project's code, then you're effectively following a practice called "Continuous Integration". In that case I'd highly recommend running a continuous integration server, such as Jenkins.
Jenkins is a very useful piece of software, easy to install and can become your automation framework for more than just building your code.
回答2:
Just use cron and call ant.sh from it.
回答3:
If you are working on a windows environment, you can use the "task scheduler" and set the interval. If you are working in unix/linux, you may use cron for scheduling your job.
来源:https://stackoverflow.com/questions/7782970/schedule-ant-task