Skip to content

Commit

Permalink
Merge pull request #124 from mojohaus/builddirectory
Browse files Browse the repository at this point in the history
Resolving "target" dir via "${project.build.directory}", so to make s…
  • Loading branch information
rfscholte committed Mar 4, 2019
2 parents 7771e91 + e6e4bcb commit 4c864cb
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/main/java/org/codehaus/mojo/exec/ExecMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ public class ExecMojo
*/
@Parameter( readonly = true, required = true, defaultValue = "${basedir}" )
private File basedir;

/**
* @since 3.0.0
*/
@Parameter( readonly = true, required = true, defaultValue = "${project.build.directory}" )
private File buildDirectory;

/**
* <p>Environment variables to pass to the executed program. For example if you want to set the LANG var:
Expand Down Expand Up @@ -482,10 +488,10 @@ private void handleArguments( List<String> commandArguments )
}
else if ( argument instanceof String && isLongModulePathArgument( (String) argument ) )
{
String filePath = "target/modulepath";
String filePath = new File( buildDirectory, "modulepath" ).getAbsolutePath();

commandArguments.add( '@' + filePath );

StringBuilder modulePath = new StringBuilder();
modulePath.append( '"' );

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

modulePath.append( '"' );

createArgFile( filePath, Arrays.asList( "-p", modulePath.toString() ) );
}
else if ( argument instanceof Classpath )
Expand All @@ -512,7 +518,7 @@ else if ( argument instanceof Classpath )
else if ( argument instanceof Modulepath )
{
Modulepath specifiedModulepath = (Modulepath) argument;

arg = computeClasspathString( specifiedModulepath );
commandArguments.add( arg );
}
Expand Down

0 comments on commit 4c864cb

Please sign in to comment.