Skip to content

[#2464] Fix picocli-codegen module-info missing provides for annotation processor - #2528

Open
arimu1 wants to merge 1 commit into
remkop:mainfrom
arimu1:fix/2464-codegen-module-provides-processor
Open

[#2464] Fix picocli-codegen module-info missing provides for annotation processor#2528
arimu1 wants to merge 1 commit into
remkop:mainfrom
arimu1:fix/2464-codegen-module-provides-processor

Conversation

@arimu1

@arimu1 arimu1 commented Aug 7, 2026

Copy link
Copy Markdown

Summary

picocli-codegen's JPMS module-info did not declare a provides … with for its annotation processor. When the jar is used on --processor-module-path, the Java module system only discovers processors listed via provides, so NativeImageConfigGeneratorProcessor was never loaded. Classpath discovery via META-INF/services continued to work.

This change adds the matching provides clause for the single processor registered in META-INF/services/javax.annotation.processing.Processor.

Fixes #2464

Changes

  • picocli-codegen/src/main/java9/module-info.java: provide javax.annotation.processing.Processor with picocli.codegen.aot.graalvm.processor.NativeImageConfigGeneratorProcessor
  • Issue2464Test: assert the module descriptor declares that provides entry (covers jar and exploded multi-release build layouts)

Verification

  • Confirmed only one Processor entry exists under META-INF/services
  • Built picocli-codegen jar and inspected META-INF/versions/9/module-info.class (provides present)
  • ./gradlew :picocli-codegen-tests-java9plus:test --tests picocli.annotation.processing.tests.Issue2464Test (JDK 17)

…notation processor

Register NativeImageConfigGeneratorProcessor via provides ... with so the
processor is discovered when picocli-codegen is on --processor-module-path.
META-INF/services remains the classpath discovery mechanism.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

picocli-codegen is missing provides ... with for service registration

1 participant