File tree Expand file tree Collapse file tree
src/main/java/org/javamodularity/moduleplugin/tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111import org .javamodularity .moduleplugin .extensions .PatchModuleContainer ;
1212import org .javamodularity .moduleplugin .internal .MutatorHelper ;
1313
14- import java .io .File ;
1514import java .util .ArrayList ;
1615import java .util .List ;
1716import java .util .stream .Collectors ;
Original file line number Diff line number Diff line change 1313
1414import java .util .ArrayList ;
1515import java .util .List ;
16+ import java .util .stream .Collectors ;
1617
1718public class RunTaskMutator extends AbstractExecutionMutator {
1819 private static final Logger LOGGER = Logging .getLogger (RunTaskMutator .class );
@@ -46,11 +47,14 @@ private List<String> buildJavaExecJvmArgs() {
4647 moduleOptions .mutateArgs (jvmArgs );
4748
4849 FileCollection classpath = mergeClassesHelper ().getMergeAdjustedClasspath (execTask .getClasspath ());
50+ FileCollection filteredClasspath = project .files (classpath .getFiles ().stream ()
51+ .filter (f -> f .isDirectory () || f .getName ().endsWith (".jar" ) || f .getName ().endsWith (".jmod" ))
52+ .collect (Collectors .toList ()).toArray ());
4953 var patchModuleContainer = PatchModuleContainer .copyOf (
5054 helper ().modularityExtension ().optionContainer ().getPatchModuleContainer ());
5155 patchModuleContainer .addDir (moduleName , helper ().mainSourceSet ().getOutput ().getResourcesDir ().getAbsolutePath ());
52- patchModuleContainer .buildModulePathOption (classpath ).ifPresent (option -> option .mutateArgs (jvmArgs ));
53- patchModuleContainer .mutator (classpath ).mutateArgs (jvmArgs );
56+ patchModuleContainer .buildModulePathOption (filteredClasspath ).ifPresent (option -> option .mutateArgs (jvmArgs ));
57+ patchModuleContainer .mutator (filteredClasspath ).mutateArgs (jvmArgs );
5458
5559 jvmArgs .addAll (execTask .getJvmArgs ());
5660
You can’t perform that action at this time.
0 commit comments