maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Cooper <...@maxcooper.com>
Subject broken build booby prize (was: how can I make a profile active when a property is NOT set?)
Date Tue, 23 May 2006 21:40:17 GMT
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 <max@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 <max@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 <max@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


Mime
View raw message