You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/05/27 19:28:39 UTC

[GitHub] [maven-enforcer] slawekjaranowski commented on a diff in pull request #152: MENFORCER-420: cache dependencies across rules

slawekjaranowski commented on code in PR #152:
URL: https://github.com/apache/maven-enforcer/pull/152#discussion_r883926656


##########
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java:
##########
@@ -120,6 +120,36 @@ protected CharSequence getErrorMessage( Artifact artifact )
         return "Found Banned Dependency: " + artifact.getId() + System.lineSeparator();
     }
 
+    private Set<Artifact> getDependenciesToCheck( EnforcerRuleHelper helper, ProjectBuildingRequest buildingRequest )
+    {
+        if ( helper == null )
+        {
+            return getDependenciesToCheck( buildingRequest );
+        }
+
+        String cacheKey = buildingRequest.getProject().getId() + "_" + searchTransitive;
+
+        // check in the cache
+        if ( helper.getContainer().getContext().contains( cacheKey ) )

Review Comment:
   I added comments in jira.



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