Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6506

Mojos are unable to load package annotations on Java >= 9

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6.0
    • Fix Version/s: 3.6.1
    • Component/s: Class Loading
    • Labels:

      Description

      On Java 9 and above, calls to java.lang.Package.getAnnotation(Class) from within a Mojo always return null (unless the package-info class has been loaded by some other means before).

      The reason appears to be an incompatibility between Java 9 and Plexus Classworlds:

      This in particular affects plugins that interact with the JAXB API because it relies on package annotations.

      A workaround is to preload the required package-info classes using loadClass; see e.g. http://svn.apache.org/viewvc?rev=1845026&view=rev.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                slachiewicz Sylwester Lachiewicz
                Reporter:
                veithen Andreas Veithen
              • Votes:
                0 Vote for this issue
                Watchers:
                6 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 - 20m
                  20m