You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Karl Heinz Marbaise (Jira)" <ji...@apache.org> on 2023/11/13 17:10:00 UTC
[jira] [Updated] (MPLUGIN-495) WARNINGs based on usage of @Component for session/MavenProject instead of @Parameter
[ https://issues.apache.org/jira/browse/MPLUGIN-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Karl Heinz Marbaise updated MPLUGIN-495:
----------------------------------------
Description:
A change of parameters like this:
{code:java}
@Parameter(defaultValue = "${project}", readonly = true, required = true)
{code}
into:
{code:java}
@Component
{code}
This will result in WARNINGs like this:
{code}
Warning: Deprecated @Component annotation for 'session' field in org.apache.maven.plugins.dependency.GetMojo: replace with @Parameter( defaultValue = "${session}", readonly = true )
{code}
The shown deprecation message is wrong. It is fine to use that for components to be injected.
was:
A change of parameters like this:
{code:java}
@Parameter(defaultValue = "${project}", readonly = true, required = true)
{code}
into:
{code:java}
@Component
{code}
This will result in WARNINGs like this:
{code}
Warning: Deprecated @Component annotation for 'session' field in org.apache.maven.plugins.dependency.GetMojo: replace with @Parameter( defaultValue = "${session}", readonly = true )
{code}
> WARNINGs based on usage of @Component for session/MavenProject instead of @Parameter
> ------------------------------------------------------------------------------------
>
> Key: MPLUGIN-495
> URL: https://issues.apache.org/jira/browse/MPLUGIN-495
> Project: Maven Plugin Tools
> Issue Type: Improvement
> Affects Versions: 3.10.2
> Reporter: Karl Heinz Marbaise
> Priority: Critical
> Fix For: next-release
>
>
> A change of parameters like this:
> {code:java}
> @Parameter(defaultValue = "${project}", readonly = true, required = true)
> {code}
> into:
> {code:java}
> @Component
> {code}
> This will result in WARNINGs like this:
> {code}
> Warning: Deprecated @Component annotation for 'session' field in org.apache.maven.plugins.dependency.GetMojo: replace with @Parameter( defaultValue = "${session}", readonly = true )
> {code}
> The shown deprecation message is wrong. It is fine to use that for components to be injected.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)