Is it possible to call or execute a Maven goal within an Ant script?
Say I have an ant target called 'distribute' and inside which I need to call a maven 'compile' goal from another pom.xml.
Is it possible to call or execute a Maven goal within an Ant script?
Say I have an ant target called 'distribute' and inside which I need to call a maven 'compile' goal from another pom.xml.
I am using the following target to run maven
clean
,install
andclean install
goals. Works fine.Your maven.home property should point to the maven home directory. For example,
Since none of the solutions worked for me, this is what I came up with:
Assuming you are running on Windows:
or on UNIX:
or if you want it to work on both UNIX and Windows:
You can also look at maven ant tasks which is now retired though as commented below. This allows you to run specific maven goals from within your ant build script. You can look at this SO question as well.