>>>>> "Wendy Smoak" <[EMAIL PROTECTED]>:
> On Dec 15, 2007 2:19 PM, Steinar Bang <[EMAIL PROTECTED]> wrote:
>> Platform: Ubuntu 7.10, Intel Pentium M, maven 2.0.4
>>
>> How does one avoid doing a maven-antrun-task when a file is present?
> Try wrapping the execution in a profile, and activating that profile
> on the presence of the file.
The main problem with profiles is that <exists> doesn't take properties,
not even proprties like ${basedir} (at least not in maven 2.0.4 which
I'm stuck with for the duration).
So you can get the <exists> to run in a particular project, but not
neccessarily when run as a part of composite, unless... well I guess you
could activate on all different paths there could be to the file
(ie. from the parent, and from the project itself), but that could get
messy pretty quick. Especially if you have to copy the
maven-antrun-plugin task to the different profiles.
The second problem with profiles is that they make the POMs hard to read
and understand.
One thing is if you can make do with setting properties in the profiles,
but that only works if you can do it in a parent (I think...?). But if
you have to put <plugins> stuff in a profile, you get one part of a
plugins config living outside the profile and one inside.
It makes it easy to overlook stuff that's actually related.
> But actually it sounds like you may want to just activate the profile
> if one of the files that would be created is _missing_.
Yes. The marker file I create with <touch> in a maven-antrun-plugin
task.
> There's an example of that on this page:
> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
Thanx! I'll give it a look.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]