Optional ant tasks in separate build.xml file invoked with Maven AntRun plugin

In a legacy development project, ant build.xml files are used for compilation and packaging. To integrate new features more easily, I decided to use Maven and the AntRun plugin. The original targets can simply be invoked as it is explained in the examples.

However, if you want to use taks not included in the default jar, e.g. the optional ant tasks, you have to correctly add the dependencies to the AntRun plugin. Unfortunately, I moved the dependencies to the global section of my pom.xml. This mistake took me a quite some time to fix, as I simply oversaw it. 🙁

Just make sure, it looks like this:


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.