Hi,

The team here want to by default skip the test/integration-test targets when
doing mvn install i.e skip test.

They would like to explicitly pass a system property when they want to
execute the tests also. Particularly when we want an automated build
happening periodically on a build machine.

We have different profiles and hence we want to control the tests. We do not
want to duplicate existing profiles and combine with this additional skip
test combination to produce more profiles.

The surefire plugin has a attribute
    <skip>boolean<skip>
that allows the test to be skipped. So by default to skip test we were
trying to do something like this

    <skip> ! ${executeUnitTest} </skip>         ( note negation of boolean )

and we have a property
    <properties>
       <executeUnitTest>false</executeUnitTest>
    </properties>

This way test is disabled by default.

To enable from command line we can then do

 -DexecuteUnitTest=true

If I cannot use NEGATION then I have to do it other way which is not
intuitive

     <skip>${skipUnitTest}</skip>

And by default
    <properties>
       <skipUnitTest>true</skipUnitTest>
    </properties>
      

And from command line we have to do

 -DskipUnitTest=false

The is like a negative logic.

I was looking for a way to keep it intuitive or if there some other way to
achieve this.

Thanks
Raj




mkr wrote:
> 
> Not sure the intent. But you can always *override* by passing in the key
> as
> system property.
> mvn -DexecuteUnitTest=true ...
> 
> 
> Thanks,
> mohan kr
> 
> -----Original Message-----
> From: rajks [mailto:ra...@hotmail.com] 
> Sent: Thursday, May 21, 2009 2:06 AM
> To: users@maven.apache.org
> Subject: Negation of boolean property
> 
> 
> Hi,
> 
> Is it possible to negate a boolean property value. I tried it like this
> below and it did not work.
> Is there a different syntax for negation ??
> 
> <properties>
>     <executeUnitTest>false</executeUnitTest>
> </properties>
> 
> In surefire plugin
>    <skip>!${executeUnitTest}</skip>
> 
> 
> If not can this syntax be supported ????
> 
> Thanks
> Raj
> -- 
> View this message in context:
> http://www.nabble.com/Negation-of-boolean-property-tp23648816p23648816.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Negation-of-boolean-property-tp23648816p23676651.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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

Reply via email to