[ 
https://issues.apache.org/jira/browse/MNG-7706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17692368#comment-17692368
 ] 

ASF GitHub Bot commented on MNG-7706:
-------------------------------------

cstamas commented on PR #1009:
URL: https://github.com/apache/maven/pull/1009#issuecomment-1440791991

   Before this is merged, we need to do something with ITs:
   * either fix IT plugins, but am afraid that will start unrolling a snow ball 
of changes
   * fix the failing 2 IT to be more specific about warning it listens for...




> Deprecate 'localRepository' mojo parameter expression
> -----------------------------------------------------
>
>                 Key: MNG-7706
>                 URL: https://issues.apache.org/jira/browse/MNG-7706
>             Project: Maven
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Tamas Cservenak
>            Assignee: Tamas Cservenak
>            Priority: Major
>             Fix For: 4.0.0, 4.0.0-alpha-5, 3.9.1
>
>
> The mojo parameter expression 'localRepository' injects type 
> {{ArtifactRepository}} that is part of the suite coming from Maven2 (predates 
> Mercury, that was superseded by Aether, today Maven Resolver).
> The problem with this interface is that it is not compatible (nor is possible 
> to adapt it) to Maven Resolver LocalRepositoryManager due lack of context. 
> Also, the use of this interface in Mojos causes issues like MNG-7663, as they 
> fully (and blindly) re-implement Maven local repository with *wired in* 
> layout.
> Moreover, Mojos using this expression are usually dragging other (legacy) 
> deprecated things as well, most typically maven-artifact-transfer, or 
> maven-dependency-tree and so on, all things that predates Maven 3.1 (are done 
> to "protect" from Aether package change happened between Maven 3.0 and Maven 
> 3.1). Today baseline for plugins is 3.2.5, so none of these "indirection" are 
> needed anymore. In fact, the use of this expression is very good sign of 
> legacy and technical debt present in given plugin. And also, these plugins 
> cripple Maven to adopt new features. This warning is a clear indicator for 
> legacy or neglected plugins.
> The type {{ArtifactRepository}} is used in Maven internally (most in 
> maven-compat, a bit less in maven-core), this is telling as well, but IMHO 
> there is no need to deprecate this interface, as:
>  * plugins who migrate from this ancient interface to Resolver will have much 
> simpler job with maven 4 API (as it is much closer to Resolver than old Maven 
> APIs)
>  * this tackles only Plugins, while Maven itself is fine, as post Maven 4 the 
> internals will be shut off, so warning Mojo authors is enough
>  * still, we should look into core where and why is this type used for
> For Maven4 there are even more proposed changes:
>  * deprecate localRepository used of {{ArtifactRepository}} type on 
> following: {{{}MavenExecutionRequest{}}}, {{MavenSession and 
> ProjectBuildingRequest}} as instance created for these are effectively not 
> used (and are created "too early" and they carry repository system session 
> anyway



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to