You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Benjamin Bentmann <be...@udo.edu> on 2008/08/16 10:09:48 UTC

Naming Convention for Goals?

Hi,

do we have an agreed naming convention for plugin goals? E.g.

   reactor:makeMyChanges

and

   dependency:purge-local-repository

obviously follow different rules. Having one naming style would ease 
memorizing since users only need to remember the words and not also 
their writing style.


Benjamin

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


RE: Naming Convention for Goals?

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Subclassing and calling the other mojo is the only way to alias. I did
this on dependency:list (alias to resolve).

I think the non-cameltoe is the more prolific defacto standard

-----Original Message-----
From: Dan Fabulich [mailto:dan@fabulich.com] 
Sent: Monday, August 18, 2008 11:15 AM
To: Maven Developers List
Subject: Re: Naming Convention for Goals?

That's interesting, and makes me want to vote for dashes going forward. 
(I'll admit that I was thinking of testCompile when I wrote my plugin,
to 
the extent that I was thinking of anything at all.)

For the record, the offending camelCase goals are:

compiler:testCompile
resources:testResources
plugin:updateRegistry
plugin:addPluginArtifactMetadata

Is it possible to create an alias for a goal name (without making a 
nearly-empty subclass, getting documented twice, etc.)?  It'd be cool to

make "test-compile" be an alias for "testCompile".

-Dan

Benjamin Bentmann wrote:

> Brett Porter wrote:
>
>> I would say the first one. The first goal I could think of to have
this was 
>> testCompile, so it probably set the precedent.
>
> While it might have been the first goal, it's apparently not today's
common 
> case. Browsing through the Apache plugins, I found only
> - maven-compiler-plugin
> - maven-resources-plugin and
> - maven-plugin-plugin
> to use camel case for goal names. The majority of existing goals from
other 
> plugins use lower case with hyphens, so this seems like a de-facto
standard. 
> Is it wise to break with that?
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> 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


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


Re: Naming Convention for Goals?

Posted by Dan Fabulich <da...@fabulich.com>.
That's interesting, and makes me want to vote for dashes going forward. 
(I'll admit that I was thinking of testCompile when I wrote my plugin, to 
the extent that I was thinking of anything at all.)

For the record, the offending camelCase goals are:

compiler:testCompile
resources:testResources
plugin:updateRegistry
plugin:addPluginArtifactMetadata

Is it possible to create an alias for a goal name (without making a 
nearly-empty subclass, getting documented twice, etc.)?  It'd be cool to 
make "test-compile" be an alias for "testCompile".

-Dan

Benjamin Bentmann wrote:

> Brett Porter wrote:
>
>> I would say the first one. The first goal I could think of to have this was 
>> testCompile, so it probably set the precedent.
>
> While it might have been the first goal, it's apparently not today's common 
> case. Browsing through the Apache plugins, I found only
> - maven-compiler-plugin
> - maven-resources-plugin and
> - maven-plugin-plugin
> to use camel case for goal names. The majority of existing goals from other 
> plugins use lower case with hyphens, so this seems like a de-facto standard. 
> Is it wise to break with that?
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> 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: Naming Convention for Goals?

Posted by Brett Porter <br...@apache.org>.
Given that datapoint, I'd agree, since I prefer the hyphened, lower  
case version myself.

Cheers,
Brett

On 19/08/2008, at 2:56 AM, Benjamin Bentmann wrote:

> Brett Porter wrote:
>
>> I would say the first one. The first goal I could think of to have  
>> this was testCompile, so it probably set the precedent.
>
> While it might have been the first goal, it's apparently not today's  
> common case. Browsing through the Apache plugins, I found only
> - maven-compiler-plugin
> - maven-resources-plugin and
> - maven-plugin-plugin
> to use camel case for goal names. The majority of existing goals  
> from other plugins use lower case with hyphens, so this seems like a  
> de-facto standard. Is it wise to break with that?
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/


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


Re: Naming Convention for Goals?

Posted by Benjamin Bentmann <be...@udo.edu>.
Brett Porter wrote:

> I would say the first one. The first goal I could think of to have this 
> was testCompile, so it probably set the precedent.

While it might have been the first goal, it's apparently not today's 
common case. Browsing through the Apache plugins, I found only
- maven-compiler-plugin
- maven-resources-plugin and
- maven-plugin-plugin
to use camel case for goal names. The majority of existing goals from 
other plugins use lower case with hyphens, so this seems like a de-facto 
standard. Is it wise to break with that?


Benjamin

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


Re: Naming Convention for Goals?

Posted by Brett Porter <br...@apache.org>.
I would say the first one. The first goal I could think of to have  
this was testCompile, so it probably set the precedent. Also helpful  
to differentiate from lifecycle phases.

- Brett

On 16/08/2008, at 6:09 PM, Benjamin Bentmann wrote:

> Hi,
>
> do we have an agreed naming convention for plugin goals? E.g.
>
>  reactor:makeMyChanges
>
> and
>
>  dependency:purge-local-repository
>
> obviously follow different rules. Having one naming style would ease  
> memorizing since users only need to remember the words and not also  
> their writing style.
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/


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


Re: Naming Convention for Goals?

Posted by Mark Struberg <st...@yahoo.de>.
The "this-is-easier-to-read vs thisIsEasierToRead argument" would apply to all parameters, not only goals.

But the minus '-' sign inside a parameter is equally hard to distinguish from the - which prefixes a parameter in unixoid systems, so I personally would prefer mixedCase notation.

$> mvn myplugin:my-goal-or-not -Dtest-switch-which-one -is-minus-and-which -one-is-parameter

LieGrue,
strub


--- Jason van Zyl <ja...@maven.org> schrieb am Mo, 18.8.2008:

> Von: Jason van Zyl <ja...@maven.org>
> Betreff: Re: Naming Convention for Goals?
> An: "Maven Developers List" <de...@maven.apache.org>
> Datum: Montag, 18. August 2008, 18:13
> Just for the record this discussion of naming has popped up
> on the  
> ruby and perl lists over the years.
> 
> Camel case naming which is what's generally used in
> Java is hard for  
> non-english speakers to grok.
> 
> this-is-easier-to-read then thisIsEasierToRead.
> 
> Just another data point.
> 
> On 18-Aug-08, at 8:57 AM, Dan Fabulich wrote:
> 
> > Wendy Smoak wrote:
> >
> >> On Sat, Aug 16, 2008 at 1:09 AM, Benjamin Bentmann
> >> <be...@udo.edu> wrote:
> >>
> >>> do we have an agreed naming convention for
> plugin goals? E.g.
> >>> reactor:makeMyChanges
> >>> and
> >>> dependency:purge-local-repository
> >>>
> >>> obviously follow different rules. Having one
> naming style would ease
> >>> memorizing since users only need to remember
> the words and not  
> >>> also their
> >>> writing style.
> >>
> >> Also for configuration parameters?  I commented on
> MWAR-159 about the
> >> naming of the
> "filteringDeploymentDescriptors" param (compared
> to
> >> 'attachClasses' for example.)
> >>
> >> I'd also drop the 'My' in the reactor
> example-- just makeChanges or
> >> updateFiles, etc.
> >
> > To clarify the goal's purpose I've renamed it
> to "makeScmChanges".
> >
> > Thanks!
> >
> > -Dan
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail:
> dev-help@maven.apache.org
> >
> 
> Thanks,
> 
> Jason
> 
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> jason at sonatype dot com
> ----------------------------------------------------------
> 
> believe nothing, no matter where you read it,
> or who has said it,
> not even if i have said it,
> unless it agrees with your own reason
> and your own common sense.
> 
>   -- Buddha
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

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


Re: Naming Convention for Goals?

Posted by Jason van Zyl <ja...@maven.org>.
Just for the record this discussion of naming has popped up on the  
ruby and perl lists over the years.

Camel case naming which is what's generally used in Java is hard for  
non-english speakers to grok.

this-is-easier-to-read then thisIsEasierToRead.

Just another data point.

On 18-Aug-08, at 8:57 AM, Dan Fabulich wrote:

> Wendy Smoak wrote:
>
>> On Sat, Aug 16, 2008 at 1:09 AM, Benjamin Bentmann
>> <be...@udo.edu> wrote:
>>
>>> do we have an agreed naming convention for plugin goals? E.g.
>>> reactor:makeMyChanges
>>> and
>>> dependency:purge-local-repository
>>>
>>> obviously follow different rules. Having one naming style would ease
>>> memorizing since users only need to remember the words and not  
>>> also their
>>> writing style.
>>
>> Also for configuration parameters?  I commented on MWAR-159 about the
>> naming of the "filteringDeploymentDescriptors" param (compared to
>> 'attachClasses' for example.)
>>
>> I'd also drop the 'My' in the reactor example-- just makeChanges or
>> updateFiles, etc.
>
> To clarify the goal's purpose I've renamed it to "makeScmChanges".
>
> Thanks!
>
> -Dan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
----------------------------------------------------------

believe nothing, no matter where you read it,
or who has said it,
not even if i have said it,
unless it agrees with your own reason
and your own common sense.

  -- Buddha


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


Re: Naming Convention for Goals?

Posted by Dan Fabulich <da...@fabulich.com>.
Wendy Smoak wrote:

> On Sat, Aug 16, 2008 at 1:09 AM, Benjamin Bentmann
> <be...@udo.edu> wrote:
>
>> do we have an agreed naming convention for plugin goals? E.g.
>>  reactor:makeMyChanges
>> and
>>  dependency:purge-local-repository
>>
>> obviously follow different rules. Having one naming style would ease
>> memorizing since users only need to remember the words and not also their
>> writing style.
>
> Also for configuration parameters?  I commented on MWAR-159 about the
> naming of the "filteringDeploymentDescriptors" param (compared to
> 'attachClasses' for example.)
>
> I'd also drop the 'My' in the reactor example-- just makeChanges or
> updateFiles, etc.

To clarify the goal's purpose I've renamed it to "makeScmChanges".

Thanks!

-Dan

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


Re: Naming Convention for Goals?

Posted by Dan Tran <da...@gmail.com>.
what about configuration's expression?  i would prefer to start with
plugin name to prevent collision.

base on last 3 discussions, we just follow java method convention will
simplified lots of confusions



-D



On Sat, Aug 16, 2008 at 7:15 AM, Wendy Smoak <ws...@gmail.com> wrote:
> On Sat, Aug 16, 2008 at 1:09 AM, Benjamin Bentmann
> <be...@udo.edu> wrote:
>
>> do we have an agreed naming convention for plugin goals? E.g.
>>  reactor:makeMyChanges
>> and
>>  dependency:purge-local-repository
>>
>> obviously follow different rules. Having one naming style would ease
>> memorizing since users only need to remember the words and not also their
>> writing style.
>
> Also for configuration parameters?  I commented on MWAR-159 about the
> naming of the "filteringDeploymentDescriptors" param (compared to
> 'attachClasses' for example.)
>
> I'd also drop the 'My' in the reactor example-- just makeChanges or
> updateFiles, etc.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> 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: Naming Convention for Goals?

Posted by Wendy Smoak <ws...@gmail.com>.
On Sat, Aug 16, 2008 at 1:09 AM, Benjamin Bentmann
<be...@udo.edu> wrote:

> do we have an agreed naming convention for plugin goals? E.g.
>  reactor:makeMyChanges
> and
>  dependency:purge-local-repository
>
> obviously follow different rules. Having one naming style would ease
> memorizing since users only need to remember the words and not also their
> writing style.

Also for configuration parameters?  I commented on MWAR-159 about the
naming of the "filteringDeploymentDescriptors" param (compared to
'attachClasses' for example.)

I'd also drop the 'My' in the reactor example-- just makeChanges or
updateFiles, etc.

-- 
Wendy

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