Skip to content

Commit 5e08b94

Browse files
authored
copy aggregate compare only on last (#188)
1 parent 2c6baa3 commit 5e08b94

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/main/java/org/apache/maven/plugins/artifact/buildinfo/AbstractBuildinfoMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ protected Map<Artifact, String> generateBuildinfo(boolean mono) throws MojoExecu
377377
}
378378
}
379379

380-
private MavenProject getLastProject() {
380+
protected MavenProject getLastProject() {
381381
int i = session.getProjects().size();
382382
while (i > 0) {
383383
MavenProject project = session.getProjects().get(--i);

src/main/java/org/apache/maven/plugins/artifact/buildinfo/CompareMojo.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,12 @@ private void compareWithReference(Map<Artifact, String> artifacts, File referenc
248248
} else {
249249
getLog().info(saved);
250250
}
251-
buildcompare = copyAggregateToRoot(buildcompare);
251+
if (session.getProjects().size() > 1) {
252+
MavenProject last = getLastProject();
253+
if (project == last) {
254+
buildcompare = copyAggregateToRoot(buildcompare);
255+
}
256+
}
252257

253258
if (ko + missing > 0) {
254259
getLog().error("[Reproducible Builds] to analyze the differences, see diffoscope instructions in "

0 commit comments

Comments
 (0)