@@ -415,13 +415,13 @@ public abstract class AbstractInvokerMojo
415
415
private File mavenHome ;
416
416
417
417
/**
418
- * mavenExecutable can either be a file relative to <code>${maven.home}/bin/</code> or an absolute file.
418
+ * mavenExecutable can either be a file relative to <code>${maven.home}/bin/</code>, test project workspace
419
+ * or an absolute file.
419
420
*
420
421
* @since 1.8
421
- * @see Invoker#setMavenExecutable(File)
422
422
*/
423
423
@ Parameter ( property = "invoker.mavenExecutable" )
424
- private String mavenExecutable ;
424
+ private File mavenExecutable ;
425
425
426
426
/**
427
427
* The <code>JAVA_HOME</code> environment variable to use for forked Maven invocations. Defaults to the current Java
@@ -501,6 +501,12 @@ public abstract class AbstractInvokerMojo
501
501
* # can be indexed
502
502
* invoker.project = sub-module
503
503
*
504
+ * # The maven executable can either be a file relative to <code>${maven.home}/bin/</code>, test project workspace
505
+ * # or an absolute file.
506
+ * # Since plugin version 3.3.0
507
+ * # can be indexed
508
+ * invoker.mavenExecutable = mvnw
509
+ *
504
510
* # The value for the environment variable MAVEN_OPTS
505
511
* # can be indexed
506
512
* invoker.mavenOpts = -Dfile.encoding=UTF-16 -Xms32m -Xmx256m
@@ -2007,14 +2013,6 @@ private boolean runBuild( File basedir, File pomFile, File settingsFile, File ac
2007
2013
throw new RunFailureException ( BuildJob .Result .FAILURE_PRE_HOOK , e );
2008
2014
}
2009
2015
2010
- // TODO - move to request
2011
- invoker .setMavenHome ( mavenHome );
2012
-
2013
- if ( mavenExecutable != null )
2014
- {
2015
- invoker .setMavenExecutable ( new File ( mavenExecutable ) );
2016
- }
2017
-
2018
2016
for ( int invocationIndex = 1 ;; invocationIndex ++ )
2019
2017
{
2020
2018
if ( invocationIndex > 1 && !invokerProperties .isInvocationDefined ( invocationIndex ) )
@@ -2031,7 +2029,7 @@ private boolean runBuild( File basedir, File pomFile, File settingsFile, File ac
2031
2029
request .setShowErrors ( showErrors );
2032
2030
request .setShowVersion ( showVersion );
2033
2031
request .setJavaHome ( actualJavaHome );
2034
-
2032
+ request . setMavenHome ( mavenHome );
2035
2033
setupLoggerForBuildJob ( logger , request );
2036
2034
2037
2035
request .setBaseDirectory ( basedir );
@@ -2639,6 +2637,7 @@ private InvokerProperties getInvokerProperties( final File projectDirectory, Pro
2639
2637
invokerProperties .setDefaultDebug ( debug );
2640
2638
invokerProperties .setDefaultGoals ( goals );
2641
2639
invokerProperties .setDefaultProfiles ( profiles );
2640
+ invokerProperties .setDefaultMavenExecutable ( mavenExecutable );
2642
2641
invokerProperties .setDefaultMavenOpts ( mavenOpts );
2643
2642
invokerProperties .setDefaultTimeoutInSeconds ( timeoutInSeconds );
2644
2643
invokerProperties .setDefaultEnvironmentVariables ( environmentVariables );
0 commit comments