Skip to content

Commit be7ebc6

Browse files
mguillemmagu
and
magu
authored
set generated source dir even if no annotation processor is configured (#139)
Co-authored-by: magu <Marc.Guillemot@parcIT.de>
1 parent 10e87b8 commit be7ebc6

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,17 @@ public CompilerResult performCompile( CompilerConfiguration config )
164164
List<String> extraSourceDirs = new ArrayList<>();
165165
if ( !isPreJava1_6( config ) )
166166
{
167+
File generatedSourcesDir = config.getGeneratedSourcesDirectory();
168+
if ( generatedSourcesDir != null )
169+
{
170+
generatedSourcesDir.mkdirs();
171+
extraSourceDirs.add( generatedSourcesDir.getAbsolutePath() );
172+
173+
//-- option to specify where annotation processor is to generate its output
174+
args.add( "-s" );
175+
args.add( generatedSourcesDir.getAbsolutePath() );
176+
}
177+
167178
//now add jdk 1.6 annotation processing related parameters
168179
String[] annotationProcessors = config.getAnnotationProcessors();
169180
List<String> processorPathEntries = config.getProcessorPathEntries();
@@ -191,16 +202,6 @@ public CompilerResult performCompile( CompilerConfiguration config )
191202
args.add( getPathString( processorPathEntries ) );
192203
}
193204

194-
File generatedSourcesDir = config.getGeneratedSourcesDirectory();
195-
if ( generatedSourcesDir != null )
196-
{
197-
generatedSourcesDir.mkdirs();
198-
extraSourceDirs.add( generatedSourcesDir.getAbsolutePath() );
199-
200-
//-- option to specify where annotation processor is to generate its output
201-
args.add( "-s" );
202-
args.add( generatedSourcesDir.getAbsolutePath() );
203-
}
204205
if ( config.getProc() != null )
205206
{
206207
args.add( "-proc:" + config.getProc() );

0 commit comments

Comments
 (0)