fixed logic around specific project name setting

This commit is contained in:
Martin Lippert
2018-07-31 14:08:51 +02:00
parent 92fbe9ecdd
commit 007b2c5f95

View File

@@ -33,19 +33,28 @@ public class RunningAppMatcher {
return RunningAppMatcher.doesProjectMatch(app, project);
}).collect(CollectorUtil.toImmutableList());
if (matchedProjects.size() > 0) {
return matchedProjects;
}
return matchedProjects;
}
return apps;
}
private static boolean doesProjectMatch(SpringBootApp app, IJavaProject project) {
if (doesProjectNameMatch(app, project)) return true;
if (doesProjectThinJarWrapperMatch(app, project)) return true;
if (doesClasspathMatch(app, project)) return true;
if (hasProjectName(app, project)) {
return doesProjectNameMatch(app, project);
}
else {
return doesProjectThinJarWrapperMatch(app, project) || doesClasspathMatch(app, project);
}
}
return false;
public static boolean hasProjectName(SpringBootApp app, IJavaProject project) {
try {
String projectName = app.getSystemProperty("spring.boot.project.name");
return projectName != null && projectName.trim().length() > 0;
}
catch (Exception e) {
return false;
}
}
public static boolean doesProjectNameMatch(SpringBootApp app, IJavaProject project) {