gnodet commented on pull request #413:
URL: https://github.com/apache/maven/pull/413#issuecomment-842039952


   > > @famod
   > > @gnodet
   > > Speaking for myself, I would propose the following
   > > 
   > > 1. deprecate the method `getArtifacts()`, and
   > > 2. introduce a new method getArtifacts( ArtifactFilter artifactFilter )
   > > 
   > > It looks to me that the plugin itself is the owner of the object 
`ArtifactFilter` and not the object `MavenProject`. WDYT?
   > 
   > That was my initial thought too. But I think it does not really work, as 
the `ArtifactFilter` is not known directly by the mojo being executed (it's 
constructed by maven internals through mojo annotations / javadoc tags iirc) 
and the call sites for `getArtifacts()` usually have no knowledge of the mojo 
being executed afaik...
   
   I may be wrong about the call sites, they may be inside the mojos most of 
the cases. 
   One possibility could be to inject the `ArtifactFilter` into mojos, in which 
case, they could easily replace the `getArtifacts()` or similar calls with 
`getArtifacts(artifactFilter)`.  Other methods like 
`getCompileClasspathElements()`, `getTestClasspathElements()`, 
`getRuntimeClasspathElements()` will need some investigation too.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to