File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/main/java/com/ibm/cldk/utils Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public class BuildProject {
29
29
* @return the maven command
30
30
*/
31
31
public static String getMavenCommand () {
32
- 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 );
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
33
File mvnWrapper = System .getProperty ("os.name" ).toLowerCase ().contains ("windows" ) ? new File (projectRootPom , "mvnw.cmd" ) : new File (projectRootPom , "mvnw" );
34
34
return commandExists (mvnWrapper .getAbsoluteFile ()).getKey () ? mvnWrapper .getAbsoluteFile ().toString () : mvnSystemCommand ;
35
35
}
@@ -40,7 +40,7 @@ public static String getMavenCommand() {
40
40
* @return the gradle command
41
41
*/
42
42
public static String getGradleCommand () {
43
- 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 );
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"
4AFD
span> : "gradle" )).filter (File ::exists ).findFirst ().map (File ::getAbsolutePath ).orElse (null );
44
44
File gradleWrapper = System .getProperty ("os.name" ).toLowerCase ().contains ("windows" ) ? new File (projectRootPom , "gradlew.bat" ) : new File (projectRootPom , "gradlew" );
45
45
46
46
return commandExists (gradleWrapper .getAbsoluteFile ()).getKey () ? gradleWrapper .getAbsoluteFile () .toString () : gradleSystemCommand ;
You can’t perform that action at this time.
0 commit comments