Skip to content

Commit ec9f646

Browse files
committed
Add missing imports
Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
1 parent 20da0eb commit ec9f646

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.nio.file.Paths;
1010
import java.text.MessageFormat;
1111
import java.util.*;
12+
import java.util.function.Predicate;
1213
import java.util.stream.Stream;
1314

1415

@@ -29,7 +30,7 @@ public class BuildProject {
2930
* @return the maven command
3031
*/
3132
public static String getMavenCommand() {
32-
String mvnSystemCommand = Arrays.stream(System.getenv("PATH").split(System.getProperty("path.separator"))).filter(Predicate.not(String::isBlank)).filter(Predicate.not(String::isEmpty)).map(path -> new File(path, System.getProperty("os.name").toLowerCase().contains("windows") ? "mvn.cmd" : "mvn")).filter(File::exists).findFirst().map(File::getAbsolutePath).orElse(null);
33+
String mvnSystemCommand = Arrays.stream(System.getenv("PATH").split(File.pathSeparator)).filter(Predicate.not(String::isBlank)).filter(Predicate.not(String::isEmpty)).map(path -> new File(path, System.getProperty("os.name").toLowerCase().contains("windows") ? "mvn.cmd" : "mvn")).filter(File::exists).findFirst().map(File::getAbsolutePath).orElse(null);
3334
File mvnWrapper = System.getProperty("os.name").toLowerCase().contains("windows") ? new File(projectRootPom, "mvnw.cmd") : new File(projectRootPom, "mvnw");
3435
return commandExists(mvnWrapper.getAbsoluteFile()).getKey() ? mvnWrapper.getAbsoluteFile().toString() : mvnSystemCommand;
3536
}
@@ -40,7 +41,7 @@ public static String getMavenCommand() {
4041
* @return the gradle command
4142
*/
4243
public static String getGradleCommand() {
43-
String gradleSystemCommand = Arrays.stream(System.getenv("PATH").split(System.getProperty("path.separator"))).filter(Predicate.not(String::isBlank)).filter(Predicate.not(String::isEmpty)).map(path -> new File(path, System.getProperty("os.name").toLowerCase().contains("windows") ? "gradle.bat" : "gradle")).filter(File::exists).findFirst().map(File::getAbsolutePath).orElse(null);
44+
String gradleSystemCommand = Arrays.stream(System.getenv("PATH").split(File.pathSeparator)).filter(Predicate.not(String::isBlank)).filter(Predicate.not(String::isEmpty)).map(path -> new File(path, System.getProperty("os.name").toLowerCase().contains("windows") ? "gradle.bat" : "gradle")).filter(File::exists).findFirst().map(File::getAbsolutePath).orElse(null);
4445
File gradleWrapper = System.getProperty("os.name").toLowerCase().contains("windows") ? new File(projectRootPom, "gradlew.bat") : new File(projectRootPom, "gradlew");
4546

4647
return commandExists(gradleWrapper.getAbsoluteFile()).getKey() ? gradleWrapper.getAbsoluteFile() .toString() : gradleSystemCommand;

0 commit comments

Comments
 (0)