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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.6.0
    • 3.6.1
    • Class Loading

    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            slachiewicz Sylwester Lachiewicz
            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

                Slack

                  Issue deployment