maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yaakov Chaikin <yaakov.chai...@gmail.com>
Subject Re: -DskipTests=true gets ignored
Date Thu, 12 Nov 2009 23:21:23 GMT
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 <dhicks@i-hicks.org> 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 <dhicks@i-hicks.org> 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: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message