[
https://issues.apache.org/jira/browse/MPLUGIN-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17248240#comment-17248240
]
Moritz Bruder commented on MPLUGIN-182:
---------------------------------------
{quote}
Still, a lot more could be said about this. For example, if I have property="p"
and there is setP(X x) and setP(Y y) which one will be chosen?
{quote}
[~wh81752], make it an error.
> Improve documentation of annotations on setters.
> ------------------------------------------------
>
> Key: MPLUGIN-182
> URL: https://issues.apache.org/jira/browse/MPLUGIN-182
> Project: Maven Plugin Tools
> Issue Type: Improvement
> Components: maven-plugin-tools-java, Plugin Plugin
> Affects Versions: 2.7
> Environment: $ mvn -version
> Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
> Java version: 1.6.0_22
> Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> Default locale: en_US, platform encoding: MacRoman
> OS name: "mac os x" version: "10.6.4" arch: "x86_64" Family: "mac"
> Reporter: wolfgang häfelinger
> Assignee: Robert Scholte
> Priority: Major
>
> According to documentation (Maven Book, p405), the following example should
> work ("You can also use these annotations on public setter methods, [..]").
> {code:java}
> /**
> * @goal echo
> * @requiresProject false
> */
> public class EchoMojo extends AbstractMojo {
> private String msg;
>
> /**
> * @parameter expression="${echo.message}"
> */
> public void setMessage(String message) {
> this.msg = message;
> }
>
> public void execute() throws
> MojoExecutionException,MojoFailureException {
> getLog().info("what now??");
> getLog().info(msg);
> getLog().info("<>");
> }
> }
> {code}
> It does not work.
> The generated plugin.xml states, that there are *no* parameters for this Mojo:
> {code:xml}
> ..
> <mojo>
> <goal>echo</goal>
> <description></description>
> <requiresDirectInvocation>false</requiresDirectInvocation>
> <requiresProject>false</requiresProject>
> <requiresReports>false</requiresReports>
> <aggregator>false</aggregator>
> <requiresOnline>false</requiresOnline>
> <inheritedByDefault>true</inheritedByDefault>
>
> <implementation>org.epo.common.maven.plugins.epo.EchoMojo</implementation>
> <language>java</language>
> <instantiationStrategy>per-lookup</instantiationStrategy>
> <executionStrategy>once-per-session</executionStrategy>
> <threadSafe>false</threadSafe>
> <parameters/>
> </mojo>
> ..
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)