Skip to content

Commit 08095df

Browse files
committed
The gradlew/mvnw path must be made absolute
Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
1 parent 1af764f commit 08095df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/ibm/cldk/utils/BuildProject.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class BuildProject {
3434
public static String getMavenCommand() {
3535
String mvnSystemCommand = Arrays.stream(System.getenv("PATH").split(System.getProperty("path.separator"))).map(path -> new File(path, System.getProperty("os.name").toLowerCase().contains("windows") ? "mvn.cmd" : "mvn")).filter(File::exists).findFirst().map(File::getAbsolutePath).orElse(null);
3636
File mvnWrapper = System.getProperty("os.name").toLowerCase().contains("windows") ? new File(projectRootPom, "mvnw.cmd") : new File(projectRootPom, "mvnw");
37-
return commandExists(mvnWrapper).getKey() ? mvnWrapper.toString() : mvnSystemCommand;
37+
return commandExists(mvnWrapper.getAbsoluteFile()).getKey() ? mvnWrapper.getAbsoluteFile().toString() : mvnSystemCommand;
3838
}
3939

4040
/**
@@ -46,7 +46,7 @@ public static String getGradleCommand() {
4646
String gradleSystemCommand = Arrays.stream(System.getenv("PATH").split(System.getProperty("path.separator"))).map(path -> new File(path, System.getProperty("os.name").toLowerCase().contains("windows") ? "gradle.bat" : "gradle")).filter(File::exists).findFirst().map(File::getAbsolutePath).orElse(null);
4747
File gradleWrapper = System.getProperty("os.name").toLowerCase().contains("windows") ? new File(projectRootPom, "gradlew.bat") : new File(projectRootPom, "gradlew");
4848

49-
return commandExists(gradleWrapper).getKey() ? gradleWrapper.toString() : gradleSystemCommand;
49+
return commandExists(gradleWrapper.getAbsoluteFile()).getKey() ? gradleWrapper.getAbsoluteFile().toString() : gradleSystemCommand;
5050
}
5151

5252
public static Path tempInitScript;

0 commit comments

Comments
 (0)