Skip to content

Commit

Permalink
bug fix for overriding dependencies while storing project data
Browse files Browse the repository at this point in the history
bug fix for overriding dependencies while storing project data
  • Loading branch information
gs-gunjan authored Sep 22, 2023
1 parent 5f15db3 commit 644463c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ else if (!projectData.get().getTransitiveDependenciesReport().isValid())
throw new IllegalStateException(String.format("Cannot calculate dependencies for project version: %s", deps.getGav()));
}
projectDependencies.addAll(projectData.get().getVersionData().getDependencies());
projectDependencies.addAll(this.dependencyUtil.overrideDependencies(directDependencies, projectData.get().getTransitiveDependenciesReport().getTransitiveDependencies(), this::getCalculatedTransitiveDependencies));
projectDependencies.addAll(projectData.get().getTransitiveDependenciesReport().getTransitiveDependencies());
}
else
{
Expand All @@ -116,7 +116,8 @@ else if (!projectData.get().getTransitiveDependenciesReport().isValid())
return new VersionDependencyReport(new ArrayList<>(), false);
}
LOGGER.info("Completed finding dependencies");
return new VersionDependencyReport(projectDependencies.stream().collect(Collectors.toList()), true);
List<ProjectVersion> finalDependencies = this.dependencyUtil.overrideDependencies(directDependencies, projectDependencies.stream().collect(Collectors.toList()), this::getCalculatedTransitiveDependencies);
return new VersionDependencyReport(finalDependencies, true);
}

private Set<ProjectVersion> getCalculatedTransitiveDependencies(List<ProjectVersion> directDependencies, boolean transitive)
Expand Down

0 comments on commit 644463c

Please sign in to comment.