Thanks a lot John ! It worked wonderfully well (and was elegant too) and I have become a fan of maven :P
- Ravi -----Original Message----- From: John Casey [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2008 2:53 PM To: Maven Users List Subject: Re: Iterating through the build based on activated profiles You could always use multiple executions of the surefire plugin, one per test type, such that when more than one test profile is active the executions are additive, and cause the surefire plugin to execute more than once. Then, you could setup your database configuration using execution-level configuration blocks that pass in system properties via surefire. There may be a more elegant solution out there, but this should work relatively well... HTH, -john Balasubramanian, Ravi Shankar wrote: > Hi all, > I sent this earlier and can someone please tell me if there is any way > to do this ? > > Thanks, > Ravi > > Hi all, > I am facing a situation where i need to iterate through (or build ) > the same maven projects depending upon the list of active profiles. To > be precise, we run some tests (testNG through the maven surefire > plugin) against a database and i need a way to run the tests against > different databases based on the list of active profiles or through > some other mechanism. I tried having a seperate maven profile for each > database type and pointing to a different properties file in each > profile. But i still could not get to the point where i can iterate > through the build (or run the tests) depending upon the list of active profiles. > > Precisely, i want to have a setup similar to the following: > > mvn -Pmysql test & mvn -Poracle test - should run the tests against a > mysql database and an oracle database respectively(which i could do ) > > mvn -Pmysql,oracle test - This should run the tests against both mysql > and oracle for which i need a solution. > > Can somebody suggest something for this ? > > PS: I dont want to change the number of mvn commands that i issue. The > build machine always runs "mvn test" once and we provide a list of > active profiles depending on the requirement. > > Regards, > Ravi > -- John Casey Developer, PMC Member - Apache Maven (http://maven.apache.org) Blog: http://www.ejlife.net/blogs/buildchimp/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
