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

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

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


##########
maven-core/src/main/java/org/apache/maven/plugin/internal/Maven3CompatDependenciesValidator.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.plugin.internal;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import org.apache.maven.plugin.PluginValidationManager;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.resolution.ArtifactDescriptorResult;
+import org.eclipse.aether.util.artifact.JavaScopes;
+
+/**
+ * Detects Maven3 plugins using maven-compat Maven2 compatibility layer.
+ *
+ * @since 3.9.3
+ */
+@Singleton
+@Named
+class Maven3CompatDependenciesValidator extends 
AbstractMavenPluginDependenciesValidator {
+
+    @Inject
+    Maven3CompatDependenciesValidator(PluginValidationManager 
pluginValidationManager) {
+        super(pluginValidationManager);
+    }
+
+    @Override
+    protected void doValidate(
+            RepositorySystemSession session,
+            Artifact pluginArtifact,
+            ArtifactDescriptorResult artifactDescriptorResult) {
+        for (org.eclipse.aether.graph.Dependency dependency : 
artifactDescriptorResult.getDependencies()) {
+            if 
("org.apache.maven".equals(dependency.getArtifact().getGroupId())
+                    && 
"maven-compat".equals(dependency.getArtifact().getArtifactId())
+                    && !JavaScopes.TEST.equals(dependency.getScope())) {
+                pluginValidationManager.reportPluginValidationIssue(
+                        session,
+                        pluginArtifact,
+                        "Plugin depends on the deprecated Maven 2.x 
compatibility layer, which may not be supported in Maven 4.x");

Review Comment:
   this says "may not be supported". It implies that there is chance that it 
may still be supported. This should be the same wording as above.





> 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