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 {
2929 * @return the maven command
3030 */
3131 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 );
3333 File mvnWrapper = System .getProperty ("os.name" ).toLowerCase ().contains ("windows" ) ? new File (projectRootPom , "mvnw.cmd" ) : new File (projectRootPom , "mvnw" );
3434 return commandExists (mvnWrapper .getAbsoluteFile ()).getKey () ? mvnWrapper .getAbsoluteFile ().toString () : mvnSystemCommand ;
3535 }
@@ -40,7 +40,7 @@ public static String getMavenCommand() {
4040 * @return the gradle command
4141 */
4242 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" : "gradle" )).filter (File ::exists ).findFirst ().map (File ::getAbsolutePath ).orElse (null );
4444 File gradleWrapper = System .getProperty ("os.name" ).toLowerCase ().contains ("windows" ) ? new File (projectRootPom , "gradlew.bat" ) : new File (projectRootPom , "gradlew" );
4545
4646 return commandExists (gradleWrapper .getAbsoluteFile ()).getKey () ? gradleWrapper .getAbsoluteFile () .toString () : gradleSystemCommand ;
You can’t perform that action at this time.
0 commit comments