Build Maven avec un Processor APT
Bonjour à tous,
J'ai un module qui compilait mais ne compile plus ; sans que je comprenne ce qui a bien pu causer ce revirement...
Dans ce module, il y a une classe destinée à servir de processeur APT mais qui n'est PAS utilisée dans le module lui-même... Apparemment c'est ça qui fait planter l'ensemble alors que je ne demande qu'à compiler sans rien d'autre. Pas compris.
Est-ce que ça dit quelque chose à quelqu'un SVP ?
Code:
1 2 3 4 5 6 7 8 9
| @SupportedAnnotationTypes(value={
"fr.xxx.soa.toolbox.locator.ServiceXXX" })
@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class ServiceXXXAnnotationProcessor extends AbstractProcessor {
@Override
public boolean process(final Set<? extends TypeElement> annotations,
final RoundEnvironment roundEnv) {
if (roundEnv.processingOver() || annotations.isEmpty()) return true;
... |
Citation:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
error: Bad service configuration file, or exception thrown while
constructing Processor object: javax.annotation.processing.Processor:
Provider fr.xxx.soa.toolbox.locator.utils.ServiceXXXAnnotationProcessor
not found
error: Bad service configuration file, or exception thrown while
constructing Processor object: javax.annotation.processing.Processor:
Provider fr.xxx.soa.toolbox.locator.utils.ServiceXXXAnnotationProcessor
not found
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
error: Bad service configuration file, or exception thrown while
constructing Processor object: javax.annotation.processing.Processor:
Provider fr.xxx.soa.toolbox.locator.utils.ServiceXXXAnnotationProcessor
not found
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:580)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:500)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:479)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:345)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:132)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:290)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException:
Compilation failure
error: Bad service configuration file, or exception thrown while
constructing Processor object: javax.annotation.processing.Processor:
Provider fr.xxx.soa.toolbox.locator.utils.ServiceXXXAnnotationProcessor
not found
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
... 16 more
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
...
<pluginManagement>
<!-- pour passer AVANT maven-resources-plugin (même PHASE), APT doit être lancé dans les POM fils ; c'est pourquoi il est simplement "pré-configuré" dans ce POM parent -->
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>1.3.8-SNAPSHOT</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>process</goal>
</goals>
<configuration>
<processors>
<processor>fr.xxx.soa.toolbox.locator.utils.ServiceXXXAnnotationProcessor</processor>
</processors>
</configuration>
</execution>
</executions>
</plugin> |
Merci pour votre aide, Thomas.