|
@@ -35,6 +35,7 @@ import picocli.CommandLine.Command;
|
|
|
/**
|
|
|
* Build command.
|
|
|
* @author Zoey76
|
|
|
+ * @author HorridoJoho
|
|
|
* @version 1.0.0
|
|
|
*/
|
|
|
@Command(name = "build", aliases = "b")
|
|
@@ -65,13 +66,16 @@ public class BuildCommand extends AbstractCommand {
|
|
|
|
|
|
private final void executeMavenWrapper(String goal, String sourceDir, Properties properties, boolean isWindows)
|
|
|
throws MavenInvocationException {
|
|
|
+ File mavenExecutable = new File("mvnw" + (isWindows ? ".cmd" : ""));
|
|
|
+ mavenExecutable.setExecutable(true);
|
|
|
+
|
|
|
InvocationRequest request = new DefaultInvocationRequest();
|
|
|
request.setPomFile(new File(sourceDir + "/pom.xml"));
|
|
|
- request.setGoals(Collections.singletonList("install"));
|
|
|
+ request.setGoals(Collections.singletonList(goal));
|
|
|
request.setProperties(properties);
|
|
|
Invoker invoker = new DefaultInvoker();
|
|
|
invoker.setMavenHome(new File(sourceDir));
|
|
|
- invoker.setMavenExecutable(new File("mvnw" + (isWindows ? ".cmd" : "")));
|
|
|
+ invoker.setMavenExecutable(mavenExecutable);
|
|
|
invoker.execute(request);
|
|
|
}
|
|
|
}
|