maven-compiler-plugin icon indicating copy to clipboard operation
maven-compiler-plugin copied to clipboard

Maven cannot automatically detect "provide javax.annotation.processing.Processor with ... " when using annotation processors

Open benrushcc opened this issue 4 months ago • 4 comments

Affected version

latest version

Bug description

`module mod.processor { requires java.compiler; provides javax.annotation.processing.Processor with mod.processor.Proc;

exports mod.processor;

}`

module mod.user { exports mod.user; requires mod.processor; }

When declaring two modules, mod.processor as an annotation processor module, and mod.user as a application module, using processor in <annotationProcessorPaths> would be failing because maven cannot automatically detect it.

The current fix would be adding META-INF/services to manually expose the SPI interface.

I know it's a particular maven issue because when using javac and jar command directly would succeed without META-INF/services provided.

benrushcc avatar Aug 20 '25 08:08 benrushcc