You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Max Cooper <ma...@maxcooper.com> on 2006/05/23 23:40:17 UTC

broken build booby prize (was: how can I make a profile active when a property is NOT set?)

The last person to break the build does keep Mr. Hankey until someone 
else breaks the build. The downside of this practice is that there is a 
somewhat reduced penalty for consecutive offenses. :-)

-Max

John Casey wrote:
> ah, I see. I like the booby prize...do they have to hold onto it until the
> next guy breaks the build? ;-)
> 
> -john
> 
> On 5/23/06, Max Cooper <ma...@maxcooper.com> wrote:
> 
>>
>> A few things make this skipping the tests by default acceptable for our
>> project:
>>
>> 1. Our tests more than double the run time of our build. Our tests take
>> a relatively long time, so there is a fairly significant productivity
>> penalty for running the tests every time a developer does a build.
>>
>> 2. Developers are encouraged to run the tests before a commit, or more
>> often, as they see fit.
>>
>> 3. We have a continuous integration server running builds with tests
>> every 3 minutes (it checks every 3 min, waits for a quiet period of 5
>> min). It emails us when the project status changes. If a test fails, we
>> will know about it very quickly. We even have a "booby prize" (South
>> Park My. Hankey doll) that will be delivered to your desk if you break
>> the build.
>>
>> -Max
>>
>> John Casey wrote:
>> > FWIW, I hope you have a *really* compelling reason to skip your unit
>> tests
>> > by default. As long as we're writing things down for posterity, in
>> > 99.999%of cases this is a very, very bad idea. It means you have to go
>> > out of your
>> > way to test your code, which means the jars you're producing most 
>> likely
>> > won't be tested.
>> >
>> > Out of curiosity, what reason did you have for this?
>> >
>> > -john
>> >
>> > On 5/22/06, Max Cooper <ma...@maxcooper.com> wrote:
>> >
>> >>
>> >> John,
>> >>
>> >> That worked! Thanks. I am pretty sure I read something about that
>> >> before, so now I feel a bit silly to have asked. :-)
>> >>
>> >> Anyway, I was asking so that I could have maven.test.skip set to true
>> by
>> >> default, but still be able to override it on the command line. It 
>> seems
>> >> like this should work without any trickery, but there is a bug in
>> >> maven's handling of system properties that prevents it from working.
>> >> With help from Kenney Westerhof and you, I've got a solution now. I am
>> >> describing it here for anyone else that might need to do this, in 
>> hopes
>> >> that they will find it in the mailing list archives.
>> >>
>> >> Put this in your settings.xml file to skip tests by default, while
>> >> retaining the ability to run them by putting 
>> -Dmaven.test.skip=false on
>> >> the command line:
>> >>
>> >>      <!-- skip tests by default, but allow override on command line 
>> -->
>> >>      <profile>
>> >>        <activation>
>> >>          <property>
>> >>            <name>!maven.test.skip</name>
>> >>          </property>
>> >>        </activation>
>> >>        <properties>
>> >>          <maven.test.skip>true</maven.test.skip>
>> >>        </properties>
>> >>      </profile>
>> >>
>> >> -Max
>> >>
>> >> John Casey wrote:
>> >> > Try:
>> >> >
>> >> > <activation><property><name>!X</name></property></activation>
>> >> >
>> >> > ...activated when the system property is undefined.
>> >> >
>> >> >
>> >>
>> <activation><property><name>X</name><value>!Y</value></property></activation> 
>>
>> >>
>> >> >
>> >> >
>> >> > ...activated when the system property's value is != Y.
>> >> >
>> >> > HTH,
>> >> >
>> >> > John
>> >> >
>> >> > On 5/22/06, Max Cooper <ma...@maxcooper.com> wrote:
>> >> >
>> >> >>
>> >> >> I guess I should have been more clear. I want a profile to be 
>> active
>> >> >> ONLY when the property X is NOT set.
>> >> >>
>> >> >> Here's my XML psuedo-code for what I want:
>> >> >>
>> >> >> <activation>
>> >> >>    <not>
>> >> >>      <property>
>> >> >>        <name>X</name>
>> >> >>      </property>
>> >> >>    </not>
>> >> >> </activation>
>> >> >>
>> >> >> I have been playing with <activeByDefault> and using 'mvn
>> >> >> help:active-profiles' to see what profiles are active, but I have
>> not
>> >> >> found a solution yet.
>> >> >>
>> >> >> -Max
>> >> >>
>> >> >> Allan Ramirez wrote:
>> >> >> > Yes, set the profile in the settings.xml  via <activeProfiles>
>> >> section.
>> >> >> >
>> >> >>
>> >>
>> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
>> >> >> >
>> >> >> > Max Cooper wrote:
>> >> >> >
>> >> >> >> I know that I can make a profile active when a property is 
>> set...
>> >> >> >> <activation><property><name>X</name></property></activation>
>> >> >> >>
>> >> >> >> Or when a property is set to a certain value...
>> >> >> >>
>> >> >>
>> >>
>> <activation><property><name>X</name><value>Y</value></property></activation> 
>>
>> >>
>> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> Is there a way to make a profile active when a certain property
>> is
>> >> NOT
>> >> >> >> set?
>> >> >> >>
>> >> >> >> Thanks,
>> >> >> >> -Max
>> >> >> >>
>> >> >> >>
>> >> ---------------------------------------------------------------------
>> >> >> >> 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
>>
>>
> 

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


Re: broken build booby prize (was: how can I make a profile active when a property is NOT set?)

Posted by Dion Gillard <di...@gmail.com>.
We use cowboy hats

On 5/24/06, Sean Hennessy <sh...@astutenetworks.com> wrote:
>
> In a prior engagement to remain anonymous we used a rubber chicken until
> corporate feared potential harassment litigation.
> The suits took all the fun out of taking turns being the village idiot.
>
> -----Original Message-----
> From: Max Cooper [mailto:max@maxcooper.com]
> Sent: Tuesday, May 23, 2006 2:40 PM
> To: Maven Users List
> Subject: broken build booby prize (was: how can I make a profile active
> when a property is NOT set?)
>
>
> The last person to break the build does keep Mr. Hankey until someone
> else breaks the build. The downside of this practice is that there is a
> somewhat reduced penalty for consecutive offenses. :-)
>
> -Max
>
> John Casey wrote:
> > ah, I see. I like the booby prize...do they have to hold onto it until
>
> > the next guy breaks the build? ;-)
> >
> > -john
> >
> > On 5/23/06, Max Cooper <ma...@maxcooper.com> wrote:
> >
> >>
> >> A few things make this skipping the tests by default acceptable for
> >> our
> >> project:
> >>
> >> 1. Our tests more than double the run time of our build. Our tests
> >> take a relatively long time, so there is a fairly significant
> >> productivity penalty for running the tests every time a developer
> >> does a build.
> >>
> >> 2. Developers are encouraged to run the tests before a commit, or
> >> more often, as they see fit.
> >>
> >> 3. We have a continuous integration server running builds with tests
> >> every 3 minutes (it checks every 3 min, waits for a quiet period of 5
>
> >> min). It emails us when the project status changes. If a test fails,
> >> we will know about it very quickly. We even have a "booby prize"
> >> (South Park My. Hankey doll) that will be delivered to your desk if
> >> you break the build.
> >>
> >> -Max
> >>
> >> John Casey wrote:
> >> > FWIW, I hope you have a *really* compelling reason to skip your
> >> > unit
> >> tests
> >> > by default. As long as we're writing things down for posterity, in
> >> > 99.999%of cases this is a very, very bad idea. It means you have to
>
> >> > go out of your way to test your code, which means the jars you're
> >> > producing most
> >> likely
> >> > won't be tested.
> >> >
> >> > Out of curiosity, what reason did you have for this?
> >> >
> >> > -john
> >> >
> >> > On 5/22/06, Max Cooper <ma...@maxcooper.com> wrote:
> >> >
> >> >>
> >> >> John,
> >> >>
> >> >> That worked! Thanks. I am pretty sure I read something about that
> >> >> before, so now I feel a bit silly to have asked. :-)
> >> >>
> >> >> Anyway, I was asking so that I could have maven.test.skip set to
> >> >> true
> >> by
> >> >> default, but still be able to override it on the command line. It
> >> seems
> >> >> like this should work without any trickery, but there is a bug in
> >> >> maven's handling of system properties that prevents it from
> >> >> working. With help from Kenney Westerhof and you, I've got a
> >> >> solution now. I am describing it here for anyone else that might
> >> >> need to do this, in
> >> hopes
> >> >> that they will find it in the mailing list archives.
> >> >>
> >> >> Put this in your settings.xml file to skip tests by default, while
>
> >> >> retaining the ability to run them by putting
> >> -Dmaven.test.skip=false on
> >> >> the command line:
> >> >>
> >> >>      <!-- skip tests by default, but allow override on command
> >> >> line
> >> -->
> >> >>      <profile>
> >> >>        <activation>
> >> >>          <property>
> >> >>            <name>!maven.test.skip</name>
> >> >>          </property>
> >> >>        </activation>
> >> >>        <properties>
> >> >>          <maven.test.skip>true</maven.test.skip>
> >> >>        </properties>
> >> >>      </profile>
> >> >>
> >> >> -Max
> >> >>
> >> >> John Casey wrote:
> >> >> > Try:
> >> >> >
> >> >> > <activation><property><name>!X</name></property></activation>
> >> >> >
> >> >> > ...activated when the system property is undefined.
> >> >> >
> >> >> >
> >> >>
> >> <activation><property><name>X</name><value>!Y</value></property></act
> >> ivation>
> >>
> >> >>
> >> >> >
> >> >> >
> >> >> > ...activated when the system property's value is != Y.
> >> >> >
> >> >> > HTH,
> >> >> >
> >> >> > John
> >> >> >
> >> >> > On 5/22/06, Max Cooper <ma...@maxcooper.com> wrote:
> >> >> >
> >> >> >>
> >> >> >> I guess I should have been more clear. I want a profile to be
> >> active
> >> >> >> ONLY when the property X is NOT set.
> >> >> >>
> >> >> >> Here's my XML psuedo-code for what I want:
> >> >> >>
> >> >> >> <activation>
> >> >> >>    <not>
> >> >> >>      <property>
> >> >> >>        <name>X</name>
> >> >> >>      </property>
> >> >> >>    </not>
> >> >> >> </activation>
> >> >> >>
> >> >> >> I have been playing with <activeByDefault> and using 'mvn
> >> >> >> help:active-profiles' to see what profiles are active, but I
> >> >> >> have
> >> not
> >> >> >> found a solution yet.
> >> >> >>
> >> >> >> -Max
> >> >> >>
> >> >> >> Allan Ramirez wrote:
> >> >> >> > Yes, set the profile in the settings.xml  via
> >> >> >> > <activeProfiles>
> >> >> section.
> >> >> >> >
> >> >> >>
> >> >>
> >> http://maven.apache.org/guides/introduction/introduction-to-profiles.
> >> html
> >> >> >> >
> >> >> >> > Max Cooper wrote:
> >> >> >> >
> >> >> >> >> I know that I can make a profile active when a property is
> >> set...
> >> >> >> >> <activation><property><name>X</name></property></activation>
> >> >> >> >>
> >> >> >> >> Or when a property is set to a certain value...
> >> >> >> >>
> >> >> >>
> >> >>
> >> <activation><property><name>X</name><value>Y</value></property></acti
> >> vation>
> >>
> >> >>
> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> Is there a way to make a profile active when a certain
> >> >> >> >> property
> >> is
> >> >> NOT
> >> >> >> >> set?
> >> >> >> >>
> >> >> >> >> Thanks,
> >> >> >> >> -Max
> >> >> >> >>
> >> >> >> >>
> >> >> ------------------------------------------------------------------
> >> >> ---
> >> >> >> >> 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
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
http://www.multitask.com.au/people/dion/
Chuck Norris sleeps with a night light. Not because Chuck Norris is afraid
of the dark, but because the dark is afraid of Chuck Norris

RE: broken build booby prize (was: how can I make a profile active when a property is NOT set?)

Posted by Sean Hennessy <sh...@astutenetworks.com>.
In a prior engagement to remain anonymous we used a rubber chicken until
corporate feared potential harassment litigation.
The suits took all the fun out of taking turns being the village idiot.

-----Original Message-----
From: Max Cooper [mailto:max@maxcooper.com] 
Sent: Tuesday, May 23, 2006 2:40 PM
To: Maven Users List
Subject: broken build booby prize (was: how can I make a profile active
when a property is NOT set?)


The last person to break the build does keep Mr. Hankey until someone 
else breaks the build. The downside of this practice is that there is a 
somewhat reduced penalty for consecutive offenses. :-)

-Max

John Casey wrote:
> ah, I see. I like the booby prize...do they have to hold onto it until

> the next guy breaks the build? ;-)
> 
> -john
> 
> On 5/23/06, Max Cooper <ma...@maxcooper.com> wrote:
> 
>>
>> A few things make this skipping the tests by default acceptable for 
>> our
>> project:
>>
>> 1. Our tests more than double the run time of our build. Our tests 
>> take a relatively long time, so there is a fairly significant 
>> productivity penalty for running the tests every time a developer 
>> does a build.
>>
>> 2. Developers are encouraged to run the tests before a commit, or 
>> more often, as they see fit.
>>
>> 3. We have a continuous integration server running builds with tests 
>> every 3 minutes (it checks every 3 min, waits for a quiet period of 5

>> min). It emails us when the project status changes. If a test fails, 
>> we will know about it very quickly. We even have a "booby prize" 
>> (South Park My. Hankey doll) that will be delivered to your desk if 
>> you break the build.
>>
>> -Max
>>
>> John Casey wrote:
>> > FWIW, I hope you have a *really* compelling reason to skip your 
>> > unit
>> tests
>> > by default. As long as we're writing things down for posterity, in 
>> > 99.999%of cases this is a very, very bad idea. It means you have to

>> > go out of your way to test your code, which means the jars you're 
>> > producing most
>> likely
>> > won't be tested.
>> >
>> > Out of curiosity, what reason did you have for this?
>> >
>> > -john
>> >
>> > On 5/22/06, Max Cooper <ma...@maxcooper.com> wrote:
>> >
>> >>
>> >> John,
>> >>
>> >> That worked! Thanks. I am pretty sure I read something about that 
>> >> before, so now I feel a bit silly to have asked. :-)
>> >>
>> >> Anyway, I was asking so that I could have maven.test.skip set to 
>> >> true
>> by
>> >> default, but still be able to override it on the command line. It
>> seems
>> >> like this should work without any trickery, but there is a bug in 
>> >> maven's handling of system properties that prevents it from 
>> >> working. With help from Kenney Westerhof and you, I've got a 
>> >> solution now. I am describing it here for anyone else that might 
>> >> need to do this, in
>> hopes
>> >> that they will find it in the mailing list archives.
>> >>
>> >> Put this in your settings.xml file to skip tests by default, while

>> >> retaining the ability to run them by putting
>> -Dmaven.test.skip=false on
>> >> the command line:
>> >>
>> >>      <!-- skip tests by default, but allow override on command 
>> >> line
>> -->
>> >>      <profile>
>> >>        <activation>
>> >>          <property>
>> >>            <name>!maven.test.skip</name>
>> >>          </property>
>> >>        </activation>
>> >>        <properties>
>> >>          <maven.test.skip>true</maven.test.skip>
>> >>        </properties>
>> >>      </profile>
>> >>
>> >> -Max
>> >>
>> >> John Casey wrote:
>> >> > Try:
>> >> >
>> >> > <activation><property><name>!X</name></property></activation>
>> >> >
>> >> > ...activated when the system property is undefined.
>> >> >
>> >> >
>> >>
>> <activation><property><name>X</name><value>!Y</value></property></act
>> ivation>
>>
>> >>
>> >> >
>> >> >
>> >> > ...activated when the system property's value is != Y.
>> >> >
>> >> > HTH,
>> >> >
>> >> > John
>> >> >
>> >> > On 5/22/06, Max Cooper <ma...@maxcooper.com> wrote:
>> >> >
>> >> >>
>> >> >> I guess I should have been more clear. I want a profile to be
>> active
>> >> >> ONLY when the property X is NOT set.
>> >> >>
>> >> >> Here's my XML psuedo-code for what I want:
>> >> >>
>> >> >> <activation>
>> >> >>    <not>
>> >> >>      <property>
>> >> >>        <name>X</name>
>> >> >>      </property>
>> >> >>    </not>
>> >> >> </activation>
>> >> >>
>> >> >> I have been playing with <activeByDefault> and using 'mvn 
>> >> >> help:active-profiles' to see what profiles are active, but I 
>> >> >> have
>> not
>> >> >> found a solution yet.
>> >> >>
>> >> >> -Max
>> >> >>
>> >> >> Allan Ramirez wrote:
>> >> >> > Yes, set the profile in the settings.xml  via 
>> >> >> > <activeProfiles>
>> >> section.
>> >> >> >
>> >> >>
>> >>
>> http://maven.apache.org/guides/introduction/introduction-to-profiles.
>> html
>> >> >> >
>> >> >> > Max Cooper wrote:
>> >> >> >
>> >> >> >> I know that I can make a profile active when a property is
>> set...
>> >> >> >> <activation><property><name>X</name></property></activation>
>> >> >> >>
>> >> >> >> Or when a property is set to a certain value...
>> >> >> >>
>> >> >>
>> >>
>> <activation><property><name>X</name><value>Y</value></property></acti
>> vation>
>>
>> >>
>> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> Is there a way to make a profile active when a certain 
>> >> >> >> property
>> is
>> >> NOT
>> >> >> >> set?
>> >> >> >>
>> >> >> >> Thanks,
>> >> >> >> -Max
>> >> >> >>
>> >> >> >>
>> >> ------------------------------------------------------------------
>> >> ---
>> >> >> >> 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
>>
>>
> 

---------------------------------------------------------------------
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