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

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

cstamas commented on code in PR #1115:
URL: https://github.com/apache/maven/pull/1115#discussion_r1201606569


##########
maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusContainerDefaultDependenciesValidator.java:
##########
@@ -40,14 +41,17 @@ class PlexusContainerDefaultDependenciesValidator extends 
AbstractMavenPluginDep
         super(pluginValidationManager);
     }
 
-    protected void doValidate(MavenSession mavenSession, MojoDescriptor 
mojoDescriptor) {
-        boolean pcdPresent = 
mojoDescriptor.getPluginDescriptor().getDependencies().stream()
-                .filter(d -> "org.codehaus.plexus".equals(d.getGroupId()))
-                .anyMatch(d -> 
"plexus-container-default".equals(d.getArtifactId()));
+    protected void doValidate(
+            RepositorySystemSession session,
+            Artifact pluginArtifact,
+            ArtifactDescriptorResult artifactDescriptorResult) {
+        boolean pcdPresent = 
artifactDescriptorResult.getDependencies().stream()
+                .filter(d -> 
"org.codehaus.plexus".equals(d.getArtifact().getGroupId()))
+                .anyMatch(d -> 
"plexus-container-default".equals(d.getArtifact().getArtifactId()));
 
         if (pcdPresent) {
             pluginValidationManager.reportPluginValidationIssue(
-                    mavenSession, mojoDescriptor, "Plugin depends on 
plexus-container-default, which is EOL");
+                    session, pluginArtifact, "Plugin depends on 
plexus-container-default, which is EOL");

Review Comment:
   For that, we'd need some "EOL marker" or some metadata?
   
   Historically, there was p-c-d (from maven2 times), that was 14 years ago 
stopped being developed (essentially)  got drop-in replacement in form of 
"plexus-shim" (that is sisu plexus). Furthermore, JSR330 migration started 
around same time, so today, there is really no reason to depend on p-c-d 
artifact (nor plexus shim, except in test scope, as PlexusTestCase is in there 
still, but also advisable to move off from that Junir3 class).





> Plugin Dependency Validations use wrong data set
> ------------------------------------------------
>
>                 Key: MNG-7789
>                 URL: https://issues.apache.org/jira/browse/MNG-7789
>             Project: Maven
>          Issue Type: Improvement
>          Components: Plugins and Lifecycle
>    Affects Versions: 3.9.2
>            Reporter: Tamas Cservenak
>            Assignee: Tamas Cservenak
>            Priority: Major
>             Fix For: 3.9.3, 4.0.0-alpha-6, 4.0.0
>
>
> They all use pluginDescriptor/dependencies, that are NOT used to calculate 
> plugin dependencies, POM is. Except for one new check (the one added in 
> MNG-7786) the others should be refactored to use POM instead.



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

Reply via email to