I suspect you have set up your profiles so that they are exclusive, or to
put it another way, activating profile2 will revert the changes in profile1
and profile2 is later in the pom so wins out.

what you could do is cheat the reactor.

Maven will execute goals and phases against each module in turn for a
continuous run of non-aggregator goals or against the aggregation root for
aggregator goals.

So if you have a foo-maven-plugin that has a aggregator goal called bar then

mvn clean install foo:bar surefire:test failsafe:test

will do the following:

1. runs the clean followed by the install lifecycle against every module in
turn
2. runs the foo:bar goal against the aggregation root
3. runs the surefire:test failsafe:test goals against every module in turn.

So if you configure the default lifecyle binding of surefire:test and
failsafe:test to have skip=true but have skip=false for the default-cli
execution the above will only run the tests if the whole build succeeds...
it is left as an exercise to the reader to configure touchstone tests for
the lifecycle goals and all but the touchstone tests for the cli goals and
to have the whole split be activated from a profile so that by default the
build does the Maven thing.


On 24 September 2013 15:42, Philippe Cambien <incubusat...@gmail.com> wrote:

> This does not seem to do the job.
> It only seems to run the second profile.
> Any other ideas?
>
>
> On Fri, Sep 13, 2013 at 2:23 PM, Baptiste Mathus <bmat...@batmat.net>wrote:
>
>> Try -Pprofile1,profile2
>> Le 13 sept. 2013 14:16, "Philippe Cambien" <incubusat...@gmail.com> a
>> écrit :
>>
>>  I tried it with maven clean install -Pprofile1 -Pprofile2 but he didn't
>>> seem to run the first profile.
>>>
>>>
>>> On Fri, Sep 13, 2013 at 2:15 PM, Baptiste Mathus <bmat...@batmat.net>wrote:
>>>
>>>> Can't you just activate both profiles in a go?
>>>> Le 13 sept. 2013 10:07, "Philippe Cambien" <incubusat...@gmail.com> a
>>>> écrit :
>>>>
>>>>>  Hello,
>>>>>
>>>>> We have a Maven profile which contains a lot of long tests.
>>>>> Before we run these tests, we want to make sure that all dependencies
>>>>> are met ie. all systems are up and running.
>>>>> How can I configure a single job to run a Maven profile first and then
>>>>> the main profile?
>>>>> The main profile shouldn't start when the first profile has failed.
>>>>>
>>>>> I know you can also do this with two seperate jobs and let the second
>>>>> job only build when the first has failed. But we don't want to do this
>>>>> because we would have to make a job for every environment so we would have
>>>>> a lot of overhead in jobs.
>>>>>
>>>>> Any ideas?
>>>>> Thanks in advance!
>>>>>
>>>>> Cheers
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Jenkins Users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Jenkins Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to