Skip to content

Commit f743bdf

Browse files
committed
Issue codehaus-plexus#147: Support module-path for ECJ
Simply add the path from the CompilerConfiguration to the command-line arguments. Also fix the --processor-module-path argument.
1 parent f410363 commit f743bdf

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

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

+13-6
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public CompilerResult performCompile( CompilerConfiguration config )
151151
{
152152
args.add( "-parameters" );
153153
}
154-
154+
155155
if(config.isFailOnWarning())
156156
{
157157
args.add("-failOnWarning");
@@ -184,9 +184,9 @@ public CompilerResult performCompile( CompilerConfiguration config )
184184
String[] annotationProcessors = config.getAnnotationProcessors();
185185
List<String> processorPathEntries = config.getProcessorPathEntries();
186186
List<String> processorModulePathEntries = config.getProcessorModulePathEntries();
187-
188-
if ( ( annotationProcessors != null && annotationProcessors.length > 0 )
189-
|| ( processorPathEntries != null && processorPathEntries.size() > 0 )
187+
188+
if ( ( annotationProcessors != null && annotationProcessors.length > 0 )
189+
|| ( processorPathEntries != null && processorPathEntries.size() > 0 )
190190
|| ( processorModulePathEntries != null && processorModulePathEntries.size() > 0 ) )
191191
{
192192
if ( annotationProcessors != null && annotationProcessors.length > 0 )
@@ -209,10 +209,10 @@ public CompilerResult performCompile( CompilerConfiguration config )
209209
args.add( "-processorpath" );
210210
args.add( getPathString( processorPathEntries ) );
211211
}
212-
212+
213213
if ( processorModulePathEntries != null && processorModulePathEntries.size() > 0 )
214214
{
215-
args.add( "-processorpath" );
215+
args.add( "--processor-module-path" );
216216
args.add( getPathString( processorModulePathEntries ) );
217217
}
218218

@@ -229,6 +229,13 @@ public CompilerResult performCompile( CompilerConfiguration config )
229229
args.add( "-classpath" );
230230
args.add( getPathString( classpathEntries ) );
231231

232+
List<String> modulepathEntries = config.getModulepathEntries();
233+
if ( modulepathEntries != null && !modulepathEntries.isEmpty() )
234+
{
235+
args.add( "--module-path" );
236+
args.add( getPathString( modulepathEntries ) );
237+
}
238+
232239
// Collect sources
233240
List<String> allSources = new ArrayList<>();
234241
for ( String source : config.getSourceLocations() )

0 commit comments

Comments
 (0)