Consider

@Parameter default-value="${project}"
private MavenProject mavenProject

This would suggest, that you use it inside the configuration of the plugin

<configuration>
  <mavenProject>???</mavenProject>
</configuration>

Also, it will appear in the goal-reports. If I'm correct readonly is used as a marker to ignore this parameter in the report.

-Robert

Op Sun, 20 May 2012 11:31:23 +0200 schreef Hervé BOUTEMY <herve.bout...@free.fr>:

@Parameter default-value="${project}"

or with javadoc tags

/**
 * @parameter default-value="${project}"
 */

no?

IIUC, the old habbit to use expression because the attribute name let think
it
can do more than default-value is the culprit: that's why renaming expression
is really important IMHO

or I'm missing something

thanks for your comments, don'thesitate to continue and try to break the
reasoning, because it seems nobody is completely sure

Regards,

Hervé

Le dimanche 20 mai 2012 10:50:26 vous avez écrit :
Hmm, maybe I was a bit too fast.

How about those standard expressions like ${project}, ${settings},
${localRepository}, etc.
These should stay readonly and AFAIK the @parameter is the only way to set
these fields.

-Robert

Op Sun, 20 May 2012 00:10:22 +0200 schreef Hervé BOUTEMY

<herve.bout...@free.fr>:
> ok, I see
> IIUC, it is an old feature we can let in javadoc tags for compatibility
> (even
> if there were warnings for a long time about this old way of configuring
> components) but at least remove from java 5 annotations, no?
>
> Le dimanche 20 mai 2012 00:05:13 Robert Scholte a écrit :
>> In the early days before @component was used, you had to use expression.
>>
>> See
>> http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-
>> moj o-params.html for example
>>
>> In that case it is very useful to have readonly.
>>
>> -Robert
>>
>>
>> Op Sat, 19 May 2012 22:44:13 +0200 schreef Hervé BOUTEMY
>>
>> <herve.bout...@free.fr>:
>> > the more I look at readonly, the mess I understand what it is intended
>> > to do.
>> >
>> > If default-value is properly used, i don't see why we would mark a
>> > parameter
>> > as readonly: simply leave it without property (or expression)
>> >
>> > What am I missing?
>> >
>> > Regards,
>> >
>> > Hervé
>> >
>> > Le mardi 15 mai 2012 10:20:00 Brett Porter a écrit :
>> >> I think these are both good ideas.
>> >>
>> >> There's a couple of things expression currently supports that
>>
>> probably
>>
>> >> shouldn't be supported under "property" to avoid confusion: -
>> >> ${project.*}
>> >> as these should be specified under a default-value (they can't be
>> >> overridden by -Dproject.XXX, etc.). - ${settings}, ${session}, etc. -
>> >> Maven
>> >> internal variables. It would be good to have some other way to
>>
>> describe
>>
>> >> them that is not @parameter, and can avoid the need for the redundant
>> >> @readonly and @required they usually come with
>> >>
>> >> Looking at that, it actually seems like readonly and required belong
>>
>> as
>>
>> >> attributes of @parameter now too.
>> >>
>> >> - Brett
>> >>
>> >> On 14/05/2012, at 5:59 AM, Hervé BOUTEMY wrote:
>> >> > As discussed previously, there was some interest in changing
>>
>> supported
>>
>> >> > tags.
>> >> >
>> >> > Now that Java 5 annotations support is ok, I already added some
>> >>
>> >> change in
>> >>
>> >> > MPLUGIN-194 [1]: you can remove ${ } when defining parameter
>> >>
>> >> expression
>> >>
>> >> > I just created MPLUGIN-196 issue [2] to rename "expression" to
>> >>
>> >> "property",
>> >>
>> >> > where ${ } would even not be supported
>> >> >
>> >> > Please comment: any objection? any better idea?
>> >> >
>> >> > Regards,
>> >> >
>> >> > Hervé
>> >> >
>> >> >
>> >> > [1] https://jira.codehaus.org/browse/MPLUGIN-194
>> >> >
>> >> > [2] https://jira.codehaus.org/browse/MPLUGIN-196
>>
>> ---------------------------------------------------------------------
>>
>> >> > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
>> >> > For additional commands, e-mail: dev-h...@maven.apache.org
>> >>
>> >> --
>> >> Brett Porter
>> >> br...@apache.org
>> >> http://brettporter.wordpress.com/
>> >> http://au.linkedin.com/in/brettporter
>> >> http://twitter.com/brettporter
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
>> >> For additional commands, e-mail: dev-h...@maven.apache.org
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
>> > For additional commands, e-mail: dev-h...@maven.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
>> For additional commands, e-mail: dev-h...@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org

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

Reply via email to