You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by Brett Porter <br...@apache.org> on 2005/01/22 13:13:58 UTC
Jason's lifecycle doco
Hi Jason,
Overall looks good so far.
A couple of things that I'm concerned that this approach might lose
sight of:
- generating the whole ejb-client thing - secondary artifacts
- generating a site, which may well invoke other portions of this
lifecycle (although it'll be great to ensure such things as tests don't
get run again like they do now, unless its deliberate)
- deliberate re-run of phases, for example after a parameter change (eg:
rerunning tests for jcoverage after instrumentation. In this case, the
parameters changed, so maybe as long as the param values contribute,
goals can be unique)
- multiple projects, multiple goals.
Questions:
- are there still prereqs to ensure that two goals contributing to a
phase can depend on being in the right order amongst themselves?
- do preGoals / postGoals get eliminated in favour of the 3 annotations
of phases?
Thanks,
Brett
Re: Jason's lifecycle doco
Posted by Brett Porter <br...@apache.org>.
>I think I'm right to say that the reason m1 has problems with goals
>being run multiple times is the attainGoal element. The normal goal
>graph that's built declaratively can be analysed to make sure a goal is
>only executed once in a session. Goals called through attainGoal aren't
>(and can't be in general) part of this analysis.
>
>
While I generally agree - a clarification: there's a one line change to
turn this on in m1 so it is only attained once. Like much, it'd break a
bunch of things though :)
The problem is more about how it is defined - usually when you declare
"do this now", that's what you want regardless. Unforunately that's not
how its been used.
So there's nothing particularly preventing using such syntax - it just
needs some safeguards from abuse.
- Brett
>If we can model the whole of the build process as a graph we can analyse
>it to prevent things being executed more than once. If we leave an
>escape hatch for plugins to invoke goals as part of their execution
>we're likely to lose this ability. (I think we're safe here, as I
>presume the plugin interface won't be extended to allow plugins to
>invoke goals.)
>
>-Mark.
>
>
>
>
Re: Jason's lifecycle doco
Posted by "Mark H. Wilkinson" <mh...@kremvax.net>.
On Sat, 2005-01-22 at 12:07 -0800, Jason van Zyl wrote:
> On Sat, 2005-01-22 at 04:13, Brett Porter wrote:
> > - generating a site, which may well invoke other portions of this
> > lifecycle (although it'll be great to ensure such things as tests don't
> > get run again like they do now, unless its deliberate)
>
> within that the analysis that Mark
> described would be invoked to prevent any duplicate work.
I think I'm right to say that the reason m1 has problems with goals
being run multiple times is the attainGoal element. The normal goal
graph that's built declaratively can be analysed to make sure a goal is
only executed once in a session. Goals called through attainGoal aren't
(and can't be in general) part of this analysis.
If we can model the whole of the build process as a graph we can analyse
it to prevent things being executed more than once. If we leave an
escape hatch for plugins to invoke goals as part of their execution
we're likely to lose this ability. (I think we're safe here, as I
presume the plugin interface won't be extended to allow plugins to
invoke goals.)
-Mark.
Re: Jason's lifecycle doco
Posted by John Casey <jd...@commonjava.org>.
> Were you ok with the integration test stuff I brought up too, making
> that phase essentially optional in some environments?
what about something like:
...
<phase>
<id>test</id>
<goal>
<id>surefire:test</id>
</goal>
<goal>
<id>cactus:test</id>
<environments>
<environment>CI</environment>
</environments>
</goal>
</phase>
...
then, we could invoke:
m2 -Denv=CI test
if we're running the build in/for the CI context, or
m2 test
for anywhere else (cactus:test doesn't run here).
Thoughts?
-john
Re: Jason's lifecycle doco
Posted by Brett Porter <br...@apache.org>.
Jason van Zyl wrote:
>Mojos would not declare their ordering needs. They would simply describe
>their parameters and what phase they fit into.
>
>
I'll have to think it through some more, but isn't it possible there'd
be two mojos participating in the same phase which must have a specific
order?
>I'll keep committing the doco changes and I should be done a first
>complete pass by tomorrow. Folks can take a peek and provide any
>feedback and I will start implementing the first pass on Tuesday
>incorporating any changes we decide as we go.
>
>
>
ok. I think it might still take some time to get through everything once
we've had a chance to think through it.
A couple of things about the current lifecycle:
- should there be process-test-classes?
- I'm a bit uneasy about test being a copy of the previous set of
phases. Considering that integration tests may also have the same set of
phases, maybe this needs to be a parameterised set of phases reused?
- naming of the phases should probably be less java-specific, though
these phases still seem to fit any language its always worth double
checking.
I'm again a bit lost about how something like jcoverage fits in. I know
a site is different, but if you assume it to be a standalone task, how
does that work?
Were you ok with the integration test stuff I brought up too, making
that phase essentially optional in some environments?
Cheers,
Brett
Re: Jason's lifecycle doco
Posted by Jason van Zyl <jv...@maven.org>.
On Sat, 2005-01-22 at 16:14, Brett Porter wrote:
> I'll have to look at your further docs - I'm not sure how this would
> work exactly. I was talking about a mojo declaring its ordering needs -
> not something the project should have to do?
Mojos would not declare their ordering needs. They would simply describe
their parameters and what phase they fit into.
> Yeah, I'm pretty happy with the direction. It'd be great if we can keep
> talking this through until we think we've covered everything possible,
> and build up a comprehensive design document in APT.
I'll keep committing the doco changes and I should be done a first
complete pass by tomorrow. Folks can take a peek and provide any
feedback and I will start implementing the first pass on Tuesday
incorporating any changes we decide as we go.
--
jvz.
Jason van Zyl
jason@maven.org
http://maven.apache.org
happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...
-- Thoreau
Re: Jason's lifecycle doco
Posted by Brett Porter <br...@apache.org>.
Ah, ok - I see it was just a directory move, apart from the addition of
integration tests.
As long as integration tests are configurable and able to be easily
turned on/off in different environments, then this sounds ok.
ie:
- I want to -not- run integration tests in dev, normally
- I want to be able to run integration tests in dev when I'm confirming
something
- I want to always run integration tests in CI and release.
Perhaps the lifecycle is actually a function (or extended for) the
environment?
Cheers,
Brett
Brett Porter wrote:
>
>>> - multiple projects, multiple goals.
>>>
>>
>>
>> Not sure what the specific concerns are, any concrete examples?
>>
>>
> You've already covered it off elsewhere, so no worries.
>
>>> Questions:
>>> - are there still prereqs to ensure that two goals contributing to a
>>> phase can depend on being in the right order amongst themselves?
>>>
>>
>>
>> This would be controlled by the order in which the mojos being used were
>> ordered in the POM. There would be no other way to have deterministic
>> ordering.
>>
>>
> I'll have to look at your further docs - I'm not sure how this would
> work exactly. I was talking about a mojo declaring its ordering needs
> - not something the project should have to do?
>
>>> - do preGoals / postGoals get eliminated in favour of the 3
>>> annotations of phases?
>>>
>>
>>
>> At this point I'm thinking that pre/post goals and prereqs would be
>> eliminated in favour of a way to modify the phases. The
>> before/around/after wouldn't be required at all.
>>
>> I'm still plugging away here but it's the first time in a while I've
>> been excited because I see a lot of the complexity of an arbitrary
>> execution chain falling away to be replaced by a defined lifecycle that
>> mojos fit themselves into.
>>
>>
> Yeah, I'm pretty happy with the direction. It'd be great if we can
> keep talking this through until we think we've covered everything
> possible, and build up a comprehensive design document in APT.
>
>> Dain and David pointed out something I missed which is the placement of
>> integration tests in the lifecycle but aside from that I think the
>> lifecycle would allow the production of any artifact.
>>
>>
> In most cases we've seemed to be leaning towards separate projects for
> integration testing. I don't mind either way to be honest, though if
> we can fit it into the original project I'd lean that way.
> In this case, I still think arbitrary test sets are a good idea rather
> than one "integration" test set (different integration points that may
> still be normal junit, as well as performance based tests that are run
> on different occasions).
>
> Ok, I'll grab a coffee and dig into the other docs you've committed :)
>
> Cheers,
> Brett
>
>
>
Re: Jason's lifecycle doco
Posted by Brett Porter <br...@apache.org>.
>>- multiple projects, multiple goals.
>>
>>
>
>Not sure what the specific concerns are, any concrete examples?
>
>
You've already covered it off elsewhere, so no worries.
>>Questions:
>>- are there still prereqs to ensure that two goals contributing to a
>>phase can depend on being in the right order amongst themselves?
>>
>>
>
>This would be controlled by the order in which the mojos being used were
>ordered in the POM. There would be no other way to have deterministic
>ordering.
>
>
I'll have to look at your further docs - I'm not sure how this would
work exactly. I was talking about a mojo declaring its ordering needs -
not something the project should have to do?
>>- do preGoals / postGoals get eliminated in favour of the 3 annotations
>>of phases?
>>
>>
>
>At this point I'm thinking that pre/post goals and prereqs would be
>eliminated in favour of a way to modify the phases. The
>before/around/after wouldn't be required at all.
>
>I'm still plugging away here but it's the first time in a while I've
>been excited because I see a lot of the complexity of an arbitrary
>execution chain falling away to be replaced by a defined lifecycle that
>mojos fit themselves into.
>
>
Yeah, I'm pretty happy with the direction. It'd be great if we can keep
talking this through until we think we've covered everything possible,
and build up a comprehensive design document in APT.
>Dain and David pointed out something I missed which is the placement of
>integration tests in the lifecycle but aside from that I think the
>lifecycle would allow the production of any artifact.
>
>
In most cases we've seemed to be leaning towards separate projects for
integration testing. I don't mind either way to be honest, though if we
can fit it into the original project I'd lean that way.
In this case, I still think arbitrary test sets are a good idea rather
than one "integration" test set (different integration points that may
still be normal junit, as well as performance based tests that are run
on different occasions).
Ok, I'll grab a coffee and dig into the other docs you've committed :)
Cheers,
Brett
Re: Jason's lifecycle doco
Posted by Michal Maczka <mm...@interia.pl>.
Jason van Zyl wrote:
>[...]
>At this point I'm thinking that pre/post goals and prereqs would be
>eliminated in favour of a way to modify the phases. The
>before/around/after wouldn't be required at all.
>
>I'm still plugging away here but it's the first time in a while I've
>been excited because I see a lot of the complexity of an arbitrary
>execution chain falling away to be replaced by a defined lifecycle that
>mojos fit themselves into.
>
>
Yeah! It looks nice. I still have some doubts here and there but I
trying to think about it.
I've been asking for "fixed lifcycle" in m1 mailing lists since a long
time!!
<note>Maybe even mojos which are supposed to be plugged into given phase
on the lifecycle
might have different interface as I imagine that they will be doing
similar things?
</note>
>Dain and David pointed out something I missed which is the placement of
>integration tests in the lifecycle but aside from that I think the
>lifecycle would allow the production of any artifact.
>
>
What about "release" lifecyle?
I am also not sure how "site" lifecycle will work in details...
You don't see a place for more then one lifecycle?
At the momement I do (just about 2-3 more)! Lifecycle which is needed
for integration tests is one of them.
Lifecycle for "releasing" projects is second.
Michal
----------------------------------------------------------------------
Galerie zdjec MOTO >>> http://link.interia.pl/f1844
Re: Jason's lifecycle doco
Posted by Jason van Zyl <jv...@maven.org>.
On Sat, 2005-01-22 at 04:13, Brett Porter wrote:
> Hi Jason,
>
> Overall looks good so far.
>
> A couple of things that I'm concerned that this approach might lose
> sight of:
> - generating the whole ejb-client thing - secondary artifacts
I have used webservice client stubs, EJB client stubs and RMI client
stubs as uses cases. In the current layout of the lifecycle it easy to
do processing on the classes (or sources) to make the stubs and
currently I'm thinking a mojo responsible for this would encapsulate the
compiling and packaging the client stubs itself.
> - generating a site, which may well invoke other portions of this
> lifecycle (although it'll be great to ensure such things as tests don't
> get run again like they do now, unless its deliberate)
The reporting and overall site production/aggregation will lie outside
of this lifecycle. A certain report may require the presence of outputs
of the artifact producing lifecycle but that can be stated. A concrete
example would be JDepend requiring the classes to be compiled in order
to perform analysis before the production of the report. So a report may
say it needs the compile phase to have completed in which case the
compile phase would be triggered: within that the analysis that Mark
described would be invoked to prevent any duplicate work. So you may do:
m2 install site
And the artifact would be produced and installed and the site would be
generated. The site may have the JDepend report produced which would
trigger the compile phase at which point the check would occur and the
source wouldn't be recompiled because everything is up-to-date.
> - deliberate re-run of phases, for example after a parameter change (eg:
> rerunning tests for jcoverage after instrumentation. In this case, the
> parameters changed, so maybe as long as the param values contribute,
> goals can be unique)
I think that the type of checking that Mark described could be used
across the board. So here I'm thinking that you might want to describe
as a dependency is the state of the parameters for a mojo. If the
parameters are the only thing that changed it would make sense to try
and run that mojo again. Think of compilation, say you compiled, then
you wanted to turn on debugging and compiled again: the sources haven't
changed but the parameters have and it seems to me it would make sense
to execute the compile again. How could we do this? Possibly have a
little cache of mojo parameters used so they can be compared to the
values right before execution. Off the top of my head I think that it
would make sense in general to execute the mojo again if the parameters
for a particular mojo's execution changed. I think that would be
relatively easy to capture in a transparent way.
> - multiple projects, multiple goals.
Not sure what the specific concerns are, any concrete examples?
> Questions:
> - are there still prereqs to ensure that two goals contributing to a
> phase can depend on being in the right order amongst themselves?
This would be controlled by the order in which the mojos being used were
ordered in the POM. There would be no other way to have deterministic
ordering.
> - do preGoals / postGoals get eliminated in favour of the 3 annotations
> of phases?
At this point I'm thinking that pre/post goals and prereqs would be
eliminated in favour of a way to modify the phases. The
before/around/after wouldn't be required at all.
I'm still plugging away here but it's the first time in a while I've
been excited because I see a lot of the complexity of an arbitrary
execution chain falling away to be replaced by a defined lifecycle that
mojos fit themselves into.
Dain and David pointed out something I missed which is the placement of
integration tests in the lifecycle but aside from that I think the
lifecycle would allow the production of any artifact.
> Thanks,
> Brett
--
jvz.
Jason van Zyl
jason@maven.org
http://maven.apache.org
happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...
-- Thoreau