[ https://issues.apache.org/jira/browse/MPIR-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17854568#comment-17854568 ]
ASF GitHub Bot commented on MPIR-455: ------------------------------------- belingueres commented on code in PR #70: URL: https://github.com/apache/maven-project-info-reports-plugin/pull/70#discussion_r1637256757 ########## src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java: ########## @@ -591,16 +595,75 @@ private void renderSectionDependencyFileDetails() { fileLength = "-"; } - tableRow(hasSealed, new String[] { - name, - fileLength, - String.valueOf(jarDetails.getNumEntries()), - String.valueOf(jarDetails.getNumClasses()), - String.valueOf(jarDetails.getNumPackages()), - jdkRevisionCellValue, - debugInformationCellValue, - sealedCellValue - }); + if (jarDetails.isMultiRelease()) { + String htmlBullet = "   • "; + String rootTag = htmlBullet + getI18nString("file.details.multirelease.root"); + String versionedTag = htmlBullet + getI18nString("file.details.multirelease.versioned"); + + // general jar information row + tableRow(hasSealed, new String[] { + name, + fileLength, + String.valueOf(jarDetails.getNumEntries()), + "", + "", + "", + "", + sealedCellValue + }); + + JarVersionedRuntimes versionedRuntimes = jarDetails.getVersionedRuntimes(); + Collection<JarVersionedRuntime> versionedRuntimeList = + versionedRuntimes.getVersionedRuntimeMap().values(); + + // workaround to count the number of root content entries + Integer versionedNumEntries = versionedRuntimeList.stream() + .map(versionedRuntime -> + versionedRuntime.getEntries().size()) + .reduce(0, Integer::sum); + Integer rootContentNumEntries = jarDetails.getNumEntries() - versionedNumEntries; + + // root content information row + tableRow(hasSealed, new String[] { + rootTag, + "", + rootContentNumEntries.toString(), + String.valueOf(jarDetails.getNumClasses()), + String.valueOf(jarDetails.getNumPackages()), Review Comment: classes, packages and jdkRevision in the JarData object belong to the root content > dependencies goal: add support for multi-release JARs > ----------------------------------------------------- > > Key: MPIR-455 > URL: https://issues.apache.org/jira/browse/MPIR-455 > Project: Maven Project Info Reports Plugin > Issue Type: Bug > Components: dependencies > Affects Versions: 3.4.5, 3.5.0 > Reporter: Gabriel Belingueres > Assignee: Michael Osipov > Priority: Major > Fix For: 3.6.0 > > Attachments: image-2024-01-04-21-12-54-861.png, > image-2024-06-02-10-58-46-991.png, image-2024-06-02-11-01-26-148.png, > image-2024-06-08-11-11-22-722.png, screenshot-1.png > > > dependencies goal reports dependencies with multi-release support with the > highest version supported in the jar file, instead of the base version. > Example: plexus-utils 4.0.0 is reported as a Java 11 dependency, but their > base version is 1.8. > !image-2024-01-04-21-12-54-861.png! > Because of this the lower "Total" rows report a wrong java version too. > > This depends on https://issues.apache.org/jira/browse/MSHARED-1256. > -- This message was sent by Atlassian Jira (v8.20.10#820010)