maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Gudian (JIRA)" <>
Subject [jira] [Resolved] (MCOMPILER-97) META-INF/services/javax.annotation.processing.Processor copied before compilation and causes error
Date Fri, 05 Feb 2016 18:03:40 GMT


Andreas Gudian resolved MCOMPILER-97.
    Resolution: Not A Problem

I'm closing this as "Not A Problem", as it's just how a) the default lifecycle works, b) javac
And (most importantly), you can just list the annotation-processors to execute specifically
(for a while now) and/or specify the processorPath explicitly (as of version 3.5) - either
one of them prevents javac from auto-detecting processors from the build classpath.

Hope that helps.

> META-INF/services/javax.annotation.processing.Processor copied before compilation and
causes error
> --------------------------------------------------------------------------------------------------
>                 Key: MCOMPILER-97
>                 URL:
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: Ubuntu 8.10, JDK 6.
>            Reporter: Jesse Glick
>         Attachments:,
> It is tricky to compile a Maven module which defines a (269-compliant) annotation processor.
If you write the code for the processor in src/main/java and register it in src/main/resources,
META-INF/services/javax.annotation.processing.Processor is copied to target/classes first,
and then javac is run. But javac is given target/classes in -classpath, so it tries to load
the processor, which of course has not been compiled yet - a chicken-and-egg problem.
> The most straightforward workaround is to specify <compilerArgument>-proc:none</compilerArgument>
in your POM. This will only work, however, if the module does not use any annotation processors
defined in dependencies. If it does, there may be some other trick involving -processorpath
and Maven variable substitution to insert the dependency classpath.
> Switching the order of resources:resources and compiler:compile would help - at least
a clean build would work - though it could still cause problems in incremental builds. Better
would be for the compiler plugin to pass -processorpath based on the dependency classpath
(i.e. -classpath minus target/classes) when using -source 1.6 or higher.

This message was sent by Atlassian JIRA

View raw message