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

Adding module-info.java breaks JMH annotation processor

    XMLWordPrintableJSON

Details

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

    Description

      1. Open testcase
      2. Run clean install. Notice that the benchmarks run.
      3. Open pom.xml and comment-out the <annotationProcessorPaths> section.
      4. Run clean install. Notice that the annotation processor does not run and the benchmarks break.
      5. Delete/rename module-info.java.
      6. Run clean install. Notice that the benchmarks work again.

      The documentation for <annotationProcessorPaths> states that by default annotation processors are detected from the classpath. It seems that adding module-info.java breaks that somehow, which is weird/unexpected because JMH exists as a dependency outside the newly-declared module.

      I did two things to prove that the annotation processor is not being invoked in step 4:

      1. Notice that target/test-classes/META-INF is not created.
      2. Place a breakpoint in org.openjdk.jmh.generators.BenchmarkProcessor and notice that it is never even constructed.

      I tried digging into the maven-compiler-plugin and plexus-compiler source-code but couldn't figure out where the problem is. The only workaround I found is to specify annotationProcessorPaths manually but it took me half a day to track down this problem.

      Any idea what is going on? Is this a bug in the plugin(s)?

      Attachments

        Activity

          People

            Unassigned Unassigned
            cowwoc Gili
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: