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

Support separate GAV list for annotation processors

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Currently, the compiler plugin searches for annotation processors on the compile class path using the default search algorithm. This can be problematic when having annotation processor JARs or their dependencies on the compile classpath adversely affects compilation behavior, sometimes even making compilation impossible.

      It should be possible to alternatively explicitly give a list of artifacts to pass in to the compiler as the annotation processor path. This would correspond to the standard "-processorpath" option. When given in this way, these artifacts (and their transitive dependencies) would have an isolated class loader which could "see" classes on the compile class path but not be "seen" by classes on the compile class path.

      This list would be defined in the compiler plugin configuration section as a list of artifacts with optional nested exclusions and that sort of thing (no scope though, as annotation processing is only applicable to compilation). I imagine that these artifacts would behave largely similarly to normal dependencies (i.e. subject to <dependencyManagement> sections), and any dependencies which are already on the compile class path would be chosen from the compile class loader rather than being duplicated in the processor class loader.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dmlloyd David M. Lloyd
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: