Skip to content

Commit 34387ac

Browse files
authored
Merge pull request #111 from codellm-devkit/make-wrapper-paths-absolute
The gradlew/mvnw path must be made absolute
2 parents 1af764f + 8040e3d commit 34387ac

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

gradle.properties

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
<<<<<<< HEAD
2-
version=1.1.1
3-
4-
=======
5-
version=1.1.0
6-
>>>>>>> 9792b653d3b4509e5b74120747e13e69417da994
1+
version=1.1.2

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)