Skip to content

Commit 4c864cb

Browse files
authored
Merge pull request #124 from mojohaus/builddirectory
Resolving "target" dir via "${project.build.directory}", so to make s…
2 parents 7771e91 + e6e4bcb commit 4c864cb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/main/java/org/codehaus/mojo/exec/ExecMojo.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ public class ExecMojo
148148
*/
149149
@Parameter( readonly = true, required = true, defaultValue = "${basedir}" )
150150
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;
151157

152158
/**
153159
* <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 )
482488
}
483489
else if ( argument instanceof String && isLongModulePathArgument( (String) argument ) )
484490
{
485-
String filePath = "target/modulepath";
486-
491+
String filePath = new File( buildDirectory, "modulepath" ).getAbsolutePath();
492+
487493
commandArguments.add( '@' + filePath );
488-
494+
489495
StringBuilder modulePath = new StringBuilder();
490496
modulePath.append( '"' );
491497

@@ -499,7 +505,7 @@ else if ( argument instanceof String && isLongModulePathArgument( (String) argum
499505
}
500506

501507
modulePath.append( '"' );
502-
508+
503509
createArgFile( filePath, Arrays.asList( "-p", modulePath.toString() ) );
504510
}
505511
else if ( argument instanceof Classpath )
@@ -512,7 +518,7 @@ else if ( argument instanceof Classpath )
512518
else if ( argument instanceof Modulepath )
513519
{
514520
Modulepath specifiedModulepath = (Modulepath) argument;
515-
521+
516522
arg = computeClasspathString( specifiedModulepath );
517523
commandArguments.add( arg );
518524
}

0 commit comments

Comments
 (0)