Uploaded image for project: 'Maven Javadoc Plugin'
  1. Maven Javadoc Plugin
  2. MJAVADOC-513

Aggregate: make order of classpath entries predictable

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.1.0
    • Component/s: javadoc
    • Labels:
      None

      Description

      The order of the classpath entries being generated in AbstractJavadocMojo.getPathElements() (https://github.com/apache/maven-javadoc-plugin/blob/12dbbde29cf6277ca311cb8afffdf02dbfe0c9b4/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java#L2601) is internally relying on a HashMap for the compile time artifacts. That is an issue if the classpath is not 100% clean (i.e. the same package is exported by multiple artifacts) because then the success depends on the order which is not predicable for regular HashMaps. Unclean classpaths are unfortunately pretty common in reality.

      To make builds more reliable please use a LinkedHashMap instead as that will keep the insertion order.

      Also since elements being returned first have a higher precedence the ones being maintained via additionalDependencies should be added first (after the module's target directory but before the compileArtifacts) to allow to enforce usage of a certain module for dedicated classes.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rfscholte Robert Scholte
                Reporter:
                kwin Konrad Windszus
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m