Fixing gradle command
@@ -27,7 +27,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
@@ -71,8 +70,12 @@ public class GradleInspectorExtractor extends Extractor<GradleInspectorContext>
gradleCommand = gradleCommand.replaceAll("dependencies", "").trim();
final List<String> arguments = new ArrayList<>();
- if (StringUtils.isBlank(gradleCommand)) {
- arguments.addAll(Arrays.asList(gradleCommand.split(" ")));
+ if (StringUtils.isNotBlank(gradleCommand)) {
+ for (String arg : gradleCommand.split(" ")) {
+ if (StringUtils.isNotBlank(arg)) {
+ arguments.add(arg);
+ }
+ }
}
arguments.add("dependencies");
arguments.add(String.format("--init-script=%s", context.gradleInspector));
