Hi Gaurang (et all),
This is my first interaction with this group. I have been scoping out php-maven for several months now that I am working as a php developer- prior to that I used Maven extensively in Java.
Someone else may have a better answer than me but I have dealt with a similar problem in the past (IE multi-stage QA process). I am going to go ahead and make as few assumptions as possible about your background. In maven you have several built in phases (IE pre-test, test, post-test, pre-integration-test, integration-test, post-integration-test, etc...) to these you can bind a number of goals (For instance, 'test'). Typically, the various plugins you invoke in your pom are tied to one (or more) of these phases and set of goals by default. For instance, the surefire plugin goals are typically executed during the test phase, the failsafe plugin during the integration-test phase, etc... However, this can be over ridden and these goals can be rebound to other phases (for instance, I worked on a project once where I rebound some goals from the failsafe plugin to the pre-test phase I think)- I have to admit, I am a little off the ball right now as far as the particulars, as I recall you can define your own custom goals and then execute them from the command line. The particulars can be found in sonatype's book.
http://www.sonatype.com/resources/books/maven-the-complete-reference
That said, rebinding goals and swapping stuff around like that can get very confusing and lead to a lot of headaches. For better or worse, Maven is very draconian in how it enforces its project structure expectations. A better way of doing what I believe you want to do, is to use multi-module projects. Using multi-module projects, you can actually string together a bunch of separate projects and run them one after another. This is nice because you have the power of Maven's dependency management system to handle interproject dependencies- including specifying how one submodule depends on another. Another option to consider (or to be used at the same time) is the idea of maven profiles. Using profiles, you can specify parameters such as QA stage specific variables, profiles can also be run side by side together (IE are not mutually exclusive). The gotcha here is that you have to be careful where your test code is located relative to your aggregating pom or else Maven will not see your source code.
Last thought, if you like Ant, Maven does support executing ant goals within Maven (
http://maven.apache.org/plugins/maven-antrun-plugin/). Personally, I would urge you to consider maven-specific ways of getting done what you need to do first and then use Ant if absolutely necessary.
Not sure if you wanted all of this information but I do hope it helps you. While you are looking at testing using maven (or ant), make sure you check out the maven site plugin and some of the various QA plugins which can be called from surefire. You can generate some awesome code analysis reports, etc...