picocli: Picocli codegen fails on module-info.java
When I include a module-info in my project (targeting Java 11) the picocli codegen annotation processor fails to execute. When I remove the module-info class it succeeds.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project example: Compilation failure
[ERROR] Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: picocli.codegen.aot.graalvm.processor.NativeImageConfigGeneratorProcessor Unable to get public no-arg constructor
piccolo deps:
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.1.4</version>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli-codegen</artifactId>
<version>4.2.0</version>
<scope>provided</scope>
</dependency>
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (14 by maintainers)
Hey @remkop! Sorry about the delay.
I just tested this again, and everything works fine with Maven when using matching versions of picocil and picocli-codegen as well as configuring picocli-codegen in the
annotationProcessorPathI just double-checked the docs, and it DOES say this is how the compiler plugin should be configured. I’m going to say this was caused by user error (and assumptions about how annotation processors get “discovered”, and of course my copypasta of the miss-matched versions)
For completeness (future googlers), the compiler plugin config should look something like this, and this IS what the picocli docs say:
Thanks again for your help!
@remkop I should have time today (or early tomorrow) to create a minimal example to help you reproduce the issue