I think "confusion" is rather subjective term. Personally, I find

    @Parameter(defaultValue="${session}")
    MavenSession session;

far more confusing than

    @Component
    MavenSession session;


This is particular true in 3.2.0, which allows injection of
MojoExecution, MavenSession and MavenProject via mojo execution Guice
scope I introduced in [1]


[1] https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commit;h=8700b058574ea79544603ee4eacd6171ef03aa46

--
Regards,
Igor

On 2/8/2014, 5:15, Hervé BOUTEMY wrote:
the confusion is that MojoExecution, MavenSession, MavenProject, and generally
everything injected by PluginParameterExpressionEvaluator [1] are not Plexus
components
Fields marked by @Component are not injected by
PluginParameterExpressionEvaluator, only fields marked by @Parameter are
injected like this

Regards,

Hervé


[1] 
http://maven.apache.org/ref/3-LATEST/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html

Le jeudi 6 février 2014 20:32:47 Igor Fedorenko a écrit :
Hervé,

Can you explain what confusion this causes?

--
Regards,
Igor

On 2/6/2014, 16:47, Hervé BOUTEMY wrote:
Hi,

You'd better not use the @Component annotation but @Parameter instead:
this is a feature that will be deprecated in future version:

http://jira.codehaus.org/browse/MPLUGIN-257

Regards,

Hervé

Le jeudi 6 février 2014 22:04:57 Karl Heinz Marbaise a écrit :
Hi,

in the meantime i found a better way (thanks to Robert Scholte):
       @Component
       private MojoExecution mojoExecution;


       mojoExecution.getExecutionId();
       mojoExecution.getConfiguration();

Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
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