@@ -148,6 +148,12 @@ public class ExecMojo
148
148
*/
149
149
@ Parameter ( readonly = true , required = true , defaultValue = "${basedir}" )
150
150
private File basedir ;
151
+
152
+ /**
153
+ * @since 3.0.0
154
+ */
155
+ @ Parameter ( readonly = true , required = true , defaultValue = "${project.build.directory}" )
156
+ private File buildDirectory ;
151
157
152
158
/**
153
159
* <p>Environment variables to pass to the executed program. For example if you want to set the LANG var:
@@ -482,10 +488,10 @@ private void handleArguments( List<String> commandArguments )
482
488
}
483
489
else if ( argument instanceof String && isLongModulePathArgument ( (String ) argument ) )
484
490
{
485
- String filePath = "target/ modulepath" ;
486
-
491
+ String filePath = new File ( buildDirectory , " modulepath" ). getAbsolutePath () ;
492
+
487
493
commandArguments .add ( '@' + filePath );
488
-
494
+
489
495
StringBuilder modulePath = new StringBuilder ();
490
496
modulePath .append ( '"' );
491
497
@@ -499,7 +505,7 @@ else if ( argument instanceof String && isLongModulePathArgument( (String) argum
499
505
}
500
506
501
507
modulePath .append ( '"' );
502
-
508
+
503
509
createArgFile ( filePath , Arrays .asList ( "-p" , modulePath .toString () ) );
504
510
}
505
511
else if ( argument instanceof Classpath )
@@ -512,7 +518,7 @@ else if ( argument instanceof Classpath )
512
518
else if ( argument instanceof Modulepath )
513
519
{
514
520
Modulepath specifiedModulepath = (Modulepath ) argument ;
515
-
521
+
516
522
arg = computeClasspathString ( specifiedModulepath );
517
523
commandArguments .add ( arg );
518
524
}
0 commit comments