I use Maven-Antrun-Plugin 1.8 to execute an Ant target that contains an <if>.
I read that ant-contrib is necessary to run this, so I included the dependency to ant-contrib:ant-contrib:1.0b3. This causes ant:ant:1.5 to be loaded transitively, which breaks the build. If I put an exclusion on ant 1.5, the <if> is again undefined.
Summarized: I need a valid dependency listing for the maven-antrun-plugin that allows me to call <if>.
Perhaps the following may help in your Maven pom:
I understand that this may not be the most optimal/efficient solution to your issue, but this is exactly what I am currently using myself and it works with no issues.