private SortedMap getMutableDependenciesHashes()

in src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java [768:810]


    private SortedMap<String, String> getMutableDependenciesHashes(String keyPrefix, List<Dependency> dependencies)
            throws IOException {
        SortedMap<String, String> result = new TreeMap<>();

        for (Dependency dependency : dependencies) {

            if (CacheUtils.isPom(dependency)) {
                // POM dependency will be resolved by maven system to actual dependencies
                // and will contribute to effective pom.
                // Effective result will be recorded by #getNormalizedPom
                // so pom dependencies must be skipped as meaningless by themselves
                continue;
            }

            // saved to index by the end of dependency build
            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;
            }
            String projectHash;
            if (dependencyProject != null) // part of multi module
            {
                projectHash =
                        projectInputCalculator.calculateInput(dependencyProject).getChecksum();
            } else // this is a snapshot dependency
            {
                DigestItem resolved = null;
                try {
                    resolved = resolveArtifact(dependency);
                } catch (ArtifactResolutionException | InvalidVersionSpecificationException e) {
                    throw new IOException(e);
                }
                projectHash = resolved.getHash();
            }
            result.put(
                    keyPrefix + KeyUtils.getVersionlessArtifactKey(createDependencyArtifact(dependency)), projectHash);
        }
        return result;
    }