Uploaded image for project: 'Maven Compiler Plugin'
  1. Maven Compiler Plugin
  2. MCOMPILER-317

Plugin generates wrong modulepath (dependencies listed in wrong order)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.7.0
    • None
    • None

    Description

      Testcase: https://github.com/cowwoc/maven-java9-class-shadowing

      If a project contains dependencies with the same module name (which is valid according to https://stackoverflow.com/a/46573805/14731) then maven-compile-plugin invokes javac with a modulepath containing dependencies in an (apparently) arbitrary order. If I place the project in one directory, I get one order. If I place the project in another directory, I get another order. This is 100% reproducible across multiple runs, across different computers.

      I suspect that somewhere deep inside the code someone is using HashMap which is leading to undefined iteration order depending on the path being used.

      Expected behavior: dependencies should be listed in the same order as declared in pom.xml (see https://stackoverflow.com/a/793193/14731)

      Actual behavior: regardless of whether I list ExtensionPresent before or after MyLibrary, the wrong order gets passed to javac.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cowwoc Gili
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: