[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-17 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1051430079


##
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java:
##
@@ -18,22 +18,15 @@
  */

Review Comment:
   I don’t think this is explicit enough in the docs. I know of several custom 
rules which leverage or extend enforcer rules classes. See also 
https://mvnrepository.com/artifact/org.apache.maven.enforcer/enforcer-rules/usages



-- 
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-unsubscr...@maven.apache.org

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



[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-17 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1051430079


##
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java:
##
@@ -18,22 +18,15 @@
  */

Review Comment:
   I don’t think this is explicit enough in the docs. I know of several custom 
rules which leverage or extend enforcer rules classes.



-- 
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-unsubscr...@maven.apache.org

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



[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-16 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1050910244


##
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenciesBase.java:
##
@@ -0,0 +1,195 @@
+/*
+ * 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.plugins.enforcer;
+
+import com.google.common.base.Strings;
+import java.util.List;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.plugins.enforcer.utils.ArtifactUtils;
+import 
org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
+import org.eclipse.aether.graph.DependencyNode;
+
+/**
+ * Abstract base class for rules which validate the transitive
+ * dependency tree by traversing all children and validating every
+ * dependency artifact.
+ */
+public abstract class BannedDependenciesBase extends 
AbstractNonCacheableEnforcerRule {

Review Comment:
   Sorry, just package protected obviously.



-- 
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-unsubscr...@maven.apache.org

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



[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-16 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1050887758


##
enforcer-rules/pom.xml:
##
@@ -112,22 +112,6 @@
   mockito-core
   test
 
-

Review Comment:
   you cannot remove that unfortunately without breaking backwards 
compatibility (maybe add a TODO already that this should be removed with 
m-enforcer 4.0.0)



-- 
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-unsubscr...@maven.apache.org

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



[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-16 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1050886285


##
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenciesBase.java:
##
@@ -0,0 +1,195 @@
+/*
+ * 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.plugins.enforcer;
+
+import com.google.common.base.Strings;
+import java.util.List;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.plugins.enforcer.utils.ArtifactUtils;
+import 
org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
+import org.eclipse.aether.graph.DependencyNode;
+
+/**
+ * Abstract base class for rules which validate the transitive
+ * dependency tree by traversing all children and validating every
+ * dependency artifact.
+ */
+public abstract class BannedDependenciesBase extends 
AbstractNonCacheableEnforcerRule {

Review Comment:
   Please make this class final (and probably also package protected) to 
prevent this from being extended by custom rules. I wouldn't necessarily expose 
further classes to custom rules.



-- 
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-unsubscr...@maven.apache.org

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



[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-16 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1050880475


##
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java:
##
@@ -18,22 +18,15 @@
  */

Review Comment:
   @slawekjaranowski Which classes do you consider so relevant that we need to 
ensure backwards-compatibility (again all of them are exposed to custom rules 
unfortunately)



-- 
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-unsubscr...@maven.apache.org

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



[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-16 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1050813950


##
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java:
##
@@ -18,22 +18,15 @@
  */

Review Comment:
   See also https://github.com/apache/maven-enforcer/pull/167.



-- 
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-unsubscr...@maven.apache.org

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



[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-16 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1050795396


##
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java:
##
@@ -18,22 +18,15 @@
  */

Review Comment:
   API here just means it is exported via the class path to all custom rules 
and can be accessed and extended. It doesn't say anything about design
   
   Potentially that affects every rule which is not a final class (because 
there is no limited visibility) but I wouldn't go that far to say that it is 
strictly necessary to keep backwards compatibility in those classes but at 
least for abstract public classes I would say we unfortunately need to be 
backwards compatible here (so first deprecate and only finally remove in 
m-enforcer-p 4.0.0)
   
   Custom rules also transitively get the dependency towards 
`maven-dependency-tree` so we must not remove this either!



-- 
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-unsubscr...@maven.apache.org

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



[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-16 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1050795396


##
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java:
##
@@ -18,22 +18,15 @@
  */

Review Comment:
   API here just means it is exported via the class path to all custom rules 
and can be accessed and extended. It doesn't say anything about design
   
   Potentially that affects every rule which is not a final class (because 
there is no limited visibility) but I wouldn't go that far to say that it is 
strictly necessary to keep backwards compatibility in those classes but at 
least for abstract public classes I would say we unfortunately need to be 
backwards compatible here (so first deprecate and only finally remove in 
m-enforcer-p 4.0.0)



-- 
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-unsubscr...@maven.apache.org

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



[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-16 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1050795396


##
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java:
##
@@ -18,22 +18,15 @@
  */

Review Comment:
   API here just means it is exported via the class path to all custom rules 
and can be accessed and extended. It doesn't say anything about design
   
   Potentially that affects every rule which is not a final class (because 
there is no limited visibility) but I wouldn't go that far to say that it is 
strictly necessary to keep backwards compatibility but for abstract public 
classes I would say yes, we unfortunately need to be backwards compatible here 
(so first deprecate and only finally remove in m-enforcer-p 4.0.0)



-- 
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-unsubscr...@maven.apache.org

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



[GitHub] [maven-enforcer] kwin commented on a diff in pull request #198: [MENFORCER-435] Replacing maven-compat and maven-dependency-tree usage with Resolver

2022-12-16 Thread GitBox


kwin commented on code in PR #198:
URL: https://github.com/apache/maven-enforcer/pull/198#discussion_r1050784182


##
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java:
##
@@ -18,22 +18,15 @@
  */

Review Comment:
   I consider this file API (other rules might extend that) so it is 
backwards-incompatible to remove any non-private methods in there or change 
their signature. We may want to deprecate things though



-- 
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-unsubscr...@maven.apache.org

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