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 2021/11/27 02:32:37 UTC

[GitHub] [maven] AlexanderAshitkin commented on a change in pull request #623: Mng 7129/master db subtree feature

AlexanderAshitkin commented on a change in pull request #623:
URL: https://github.com/apache/maven/pull/623#discussion_r757731621



##########
File path: maven-caching/src/main/java/org/apache/maven/caching/checksum/MavenProjectInput.java
##########
@@ -743,75 +695,49 @@ private boolean isFilteredOutSubpath( Path path )
             }
 
             // saved to index by the end of dependency build
-            final boolean currentlyBuilding = isBuilding( dependency );
-            final boolean partOfMultiModule = strategy.isPartOfMultiModule( dependency );
-            if ( !currentlyBuilding && !partOfMultiModule && !isSnapshot( dependency.getVersion() ) )
+            MavenProject dependencyProject = multiModuleSupport.tryToResolveProject(
+                            dependency.getGroupId(),
+                            dependency.getArtifactId(),
+                            dependency.getVersion() )
+                    .orElse( null );
+            boolean isSnapshot = isSnapshot( dependency.getVersion() );
+            if ( dependencyProject == null && !isSnapshot )
             {
                 // external immutable dependency, should skip
                 continue;
             }
-
-            final Artifact dependencyArtifact = repoSystem.createDependencyArtifact( dependency );
-            final String artifactKey = KeyUtils.getArtifactKey( dependencyArtifact );
-            DigestItem resolved = null;
-            if ( currentlyBuilding )
+            String projectHash;
+            if ( dependencyProject != null ) //part of multi module
             {
-                resolved = projectArtifactsByKey.get( artifactKey );
-                if ( resolved == null )
-                {
-                    throw new DependencyNotResolvedException( "Expected dependency not resolved: " + dependency );
-                }
+                projectHash = projectInputCalculator.calculateInput( dependencyProject ).getChecksum();

Review comment:
       result is not cached, potentially could be recalculated many times for the same dependency in different modules




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