You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2023/03/12 18:12:20 UTC

[GitHub] [maven-enforcer] elharo commented on a diff in pull request #246: [MENFORCER-470] AdvancedDependencyConvergence rule

elharo commented on code in PR #246:
URL: https://github.com/apache/maven-enforcer/pull/246#discussion_r1133300217


##########
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/DependencyConvergence.java:
##########
@@ -35,8 +36,10 @@
 import org.eclipse.aether.graph.DependencyNode;
 import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector;
 
-import static org.apache.maven.artifact.Artifact.SCOPE_PROVIDED;
-import static org.apache.maven.artifact.Artifact.SCOPE_TEST;
+import static org.apache.maven.artifact.Artifact.SCOPE_COMPILE;

Review Comment:
   static imports don't really help here



##########
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/DependencyConvergence.java:
##########
@@ -50,6 +53,8 @@ public final class DependencyConvergence extends AbstractStandardEnforcerRule {
 
     private List<String> excludes;
 
+    private List<String> scopes = Arrays.asList(SCOPE_COMPILE, SCOPE_RUNTIME, SCOPE_IMPORT, SCOPE_SYSTEM);

Review Comment:
   It's implied that this can be changed but I don't see where?



##########
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/DependencyConvergence.java:
##########
@@ -142,7 +146,7 @@ private String buildConvergenceErrorMsg(List<DependencyNode> nodeList) {
     @Override
     public String toString() {
         return String.format(
-                "DependencyConvergence[includes=%s, excludes=%s, uniqueVersions=%b]",
-                includes, excludes, uniqueVersions);
+                "DependencyConvergence[includes=%s, excludes=%s, uniqueVersions=%b, scopes=%s]",

Review Comment:
   no need to include the constant list scopes in the output here



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org