Well, the thing is that I have a couple of requirements: 1) When doing mvn install all tests should run (without specifying a profile) 2) When doing mvn install -DskipTests=true, no tests should run 3) When doing mvn install -P sandbox, no tests should run 4) When doing mvn install -P sandbox, only some of the modules should run their tests (the ones that don't hit any outside resources like a DB).
How would I do that? Thanks for your help! Yaakov. On Thu, Nov 12, 2009 at 5:49 PM, David C. Hicks <[email protected]> wrote: > I generally use a Profile when I want to do something of this nature. > So, for your case, you might have something like... > > <properties> > <skipTests>true</skipTests> > </properties> > > <profiles> > <profile> > <id>run-tests</id> > <properties> > <skipTests>false</skipTests> > </properties> > </profile> > </profiles> > > Then by simply calling Maven with the profile activated, you can run the > tests... > > mvn -Prun-tests clean install > > > Yaakov Chaikin wrote: >> Right... I figured that... But why? Isn't something on the >> command-line supposed to trump it all? >> >> Any suggestions on how to correct this? >> >> Thanks, >> Yaakov. >> >> >> On Thu, Nov 12, 2009 at 5:23 PM, David C. Hicks <[email protected]> wrote: >> >>> I think it's an order-of-evaluation problem. I suspect that your >>> -DskipTests=true is getting overridden by the <property> in your pom.xml. >>> >>> Yaakov Chaikin wrote: >>> >>>> Ok, >>>> >>>> Checked documentation, googled. Still not understanding why the >>>> following is happening. >>>> >>>> I have a multi-module project. In the root pom.xml, I have: >>>> <properties> >>>> <skipTests>true</skipTests> >>>> <properties> >>>> >>>> >>>> In my child pom.xml I have the following: >>>> >>>> <properties> >>>> <skipTests>${skipSelfContainingTests}</skipTests> >>>> <properties> >>>> >>>> In my settings.xml, I have this: >>>> <properties> >>>> <skipSelfContainingTests>false</skipSelfContainingTests> >>>> </properties> >>>> >>>> When I do mvn help:effective-pom on the child module, it does show >>>> that my skipTests=false. However, when I do mvn help:effective-pom >>>> -DskipTests=true, the effective pom STILL shows up with >>>> skipTests=false! >>>> >>>> What am I doing wrong here? >>>> >>>> Thanks, >>>> Yaakov. >>>> >>>> --------------------------------------------------------------------- >>>> 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] >>> >>> >>> >> >> --------------------------------------------------------------------- >> 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
