How can I use an Ant taskdef that depends on lib imported by ivy

前端 未结 3 1145
Happy的楠姐
Happy的楠姐 2021-01-25 11:39

I\'ve created a taskdef in my build.xml that depends on a class that resides in a jar imported by Ivy.

I\'d like to understand if it\'s possible in any way, given the fa

3条回答
  •  长情又很酷
    2021-01-25 12:24

    Yes, it is possible. However, it means that you must resolve and retrieve the jars before that task is executed. There are two ways to do this:

    • Put the and a task before the task. All three can be outside of a . However, in that case, if you run a clean, these three tasks will be executed first before the clean which means a simple clean will take longer, and you have to make sure you don't clean anything done during the and the .

    • Put all three in their own target, then make the target which is dependent upon that third party jar dependent upon the target that retrieves the Ivy jars and defines the task. This can be difficult with something like the Ant-Contrib tasks which may be used by almost all of the tasks, but should be easier with things like some sort of packaging task that's used at the very end of your build process.

提交回复
热议问题