From 388718b870a0d28bb7038490d86b010a5522878c Mon Sep 17 00:00:00 2001 From: magu Date: Thu, 17 Jun 2021 16:40:19 +0200 Subject: [PATCH] set generated source dir even if no annotation processor is configured --- .../compiler/eclipse/EclipseJavaCompiler.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java b/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java index 2186c4ef..d5fd7045 100644 --- a/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java +++ b/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java @@ -164,6 +164,17 @@ public CompilerResult performCompile( CompilerConfiguration config ) List extraSourceDirs = new ArrayList<>(); if ( !isPreJava1_6( config ) ) { + File generatedSourcesDir = config.getGeneratedSourcesDirectory(); + if ( generatedSourcesDir != null ) + { + generatedSourcesDir.mkdirs(); + extraSourceDirs.add( generatedSourcesDir.getAbsolutePath() ); + + //-- option to specify where annotation processor is to generate its output + args.add( "-s" ); + args.add( generatedSourcesDir.getAbsolutePath() ); + } + //now add jdk 1.6 annotation processing related parameters String[] annotationProcessors = config.getAnnotationProcessors(); List processorPathEntries = config.getProcessorPathEntries(); @@ -191,16 +202,6 @@ public CompilerResult performCompile( CompilerConfiguration config ) args.add( getPathString( processorPathEntries ) ); } - File generatedSourcesDir = config.getGeneratedSourcesDirectory(); - if ( generatedSourcesDir != null ) - { - generatedSourcesDir.mkdirs(); - extraSourceDirs.add( generatedSourcesDir.getAbsolutePath() ); - - //-- option to specify where annotation processor is to generate its output - args.add( "-s" ); - args.add( generatedSourcesDir.getAbsolutePath() ); - } if ( config.getProc() != null ) { args.add( "-proc:" + config.getProc() );