[
https://issues.apache.org/jira/browse/MBUILDCACHE-87?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17852556#comment-17852556
]
ASF GitHub Bot commented on MBUILDCACHE-87:
-------------------------------------------
AlexanderAshitkin commented on code in PR #146:
URL:
https://github.com/apache/maven-build-cache-extension/pull/146#discussion_r1623253391
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -620,14 +631,26 @@ private static boolean isReadable(Path entry) throws
IOException {
}
private SortedMap<String, String> getMutableDependencies() throws
IOException {
+ return getMutableDependenciesHashes("", project.getDependencies());
+ }
+
+ private SortedMap<String, String> getMutablePluginDependencies() throws
IOException {
+ SortedMap<String, String> fullMap = new TreeMap<>();
+ for (Plugin plugin : project.getBuildPlugins()) {
+ if (config.isPluginDependenciesExcluded(plugin)) {
+ continue;
+ }
+ fullMap.putAll(getMutableDependenciesHashes(
+
KeyUtils.getVersionlessArtifactKey(repoSystem.createPluginArtifact(plugin)) +
"|",
Review Comment:
Maven allows the same plugin to run more than once with different dependency
sets. In this case, the last plugin declaration wins, the dependencies of the
first plugin are discarded, and the checksum might be incorrect. Every plugin
declaration must contribute to the checksum—instead of the map, the result
should be a list of items.
> Checksum should consider plugin dependencies
> --------------------------------------------
>
> Key: MBUILDCACHE-87
> URL: https://issues.apache.org/jira/browse/MBUILDCACHE-87
> Project: Maven Build Cache Extension
> Issue Type: Improvement
> Reporter: Réda Housni Alaoui
> Priority: Major
> Labels: pull-request-available
>
> I have a multi module project where module A is used as a dependency of
> maven-dependency-plugin:unpack declared in module B.
> {{buildinfo.xml}} of module B does not consider module A as a dependency.
> Maybe something similar to
> https://github.com/apache/maven-build-cache-extension/blob/6eb05e61fdfa7be1ad44cf6afc13958b0c6ea4a6/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java#L602
> should be added for plugin dependencies?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)