You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Vincent Massol <vm...@pivolis.com> on 2005/06/24 10:03:45 UTC

[m2] How do I prevent a goal from being called?

Hi,

I have a Mojo that is called by another one and I'd like to prevent the
called Mojo from being invoked directly by the user. Is there a tag for
this?

The use case is the clover plugin. The clover:check goal spawns a new
lifecycle that calls the clover:instrument goal. The spawned lifeycle
defines a new output dir. If users call directly the clover:instrument goal
the generated sources will go in the main output dir and the generated will
then be compiled by any compiler goal. I'd like to avoid this by preventing
users from calling clover:instrument.

Thanks
-Vincent


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


Re: [m2] How do I prevent a goal from being called?

Posted by Brett Porter <br...@apache.org>.
File it in JIRA, sounds reasonable. Though in this specific case, I 
would expect that outputDirectory shouldn't default to anything, but 
still be required (and configured via the lifecycle.xml file). That way 
the user could call it standalone and pass it a directory. I think it is 
good to make individual mojos generally useful as much as possible.

- Brett

Vincent Massol wrote:

>  
>
>>-----Original Message-----
>>From: Jason van Zyl [mailto:jason@maven.org]
>>Sent: samedi 25 juin 2005 03:16
>>To: Maven Developers List
>>Subject: Re: [m2] How do I prevent a goal from being called?
>>
>>On Fri, 2005-06-24 at 10:03 +0200, Vincent Massol wrote:
>>    
>>
>>>Hi,
>>>
>>>I have a Mojo that is called by another one and I'd like to prevent the
>>>called Mojo from being invoked directly by the user. Is there a tag for
>>>this?
>>>
>>>The use case is the clover plugin. The clover:check goal spawns a new
>>>lifecycle that calls the clover:instrument goal. The spawned lifeycle
>>>defines a new output dir. If users call directly the clover:instrument
>>>      
>>>
>>goal
>>    
>>
>>>the generated sources will go in the main output dir and the generated
>>>      
>>>
>>will
>>    
>>
>>>then be compiled by any compiler goal. I'd like to avoid this by
>>>      
>>>
>>preventing
>>    
>>
>>>users from calling clover:instrument.
>>>      
>>>
>>So a mechanism where we could state a goal can only participate as part
>>of a lifecycle? Basically make the goal non-visible for direct use?
>>    
>>
>
>Yep, exactly.
>
>Thanks
>-Vincent
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>
>  
>


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


RE: [m2] How do I prevent a goal from being called?

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Jason van Zyl [mailto:jason@maven.org]
> Sent: samedi 25 juin 2005 03:16
> To: Maven Developers List
> Subject: Re: [m2] How do I prevent a goal from being called?
> 
> On Fri, 2005-06-24 at 10:03 +0200, Vincent Massol wrote:
> > Hi,
> >
> > I have a Mojo that is called by another one and I'd like to prevent the
> > called Mojo from being invoked directly by the user. Is there a tag for
> > this?
> >
> > The use case is the clover plugin. The clover:check goal spawns a new
> > lifecycle that calls the clover:instrument goal. The spawned lifeycle
> > defines a new output dir. If users call directly the clover:instrument
> goal
> > the generated sources will go in the main output dir and the generated
> will
> > then be compiled by any compiler goal. I'd like to avoid this by
> preventing
> > users from calling clover:instrument.
> 
> So a mechanism where we could state a goal can only participate as part
> of a lifecycle? Basically make the goal non-visible for direct use?

Yep, exactly.

Thanks
-Vincent


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


Re: [m2] How do I prevent a goal from being called?

Posted by Jason van Zyl <ja...@maven.org>.
On Fri, 2005-06-24 at 10:03 +0200, Vincent Massol wrote:
> Hi,
> 
> I have a Mojo that is called by another one and I'd like to prevent the
> called Mojo from being invoked directly by the user. Is there a tag for
> this?
> 
> The use case is the clover plugin. The clover:check goal spawns a new
> lifecycle that calls the clover:instrument goal. The spawned lifeycle
> defines a new output dir. If users call directly the clover:instrument goal
> the generated sources will go in the main output dir and the generated will
> then be compiled by any compiler goal. I'd like to avoid this by preventing
> users from calling clover:instrument.

So a mechanism where we could state a goal can only participate as part
of a lifecycle? Basically make the goal non-visible for direct use?

> Thanks
> -Vincent
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org



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