use of com.github.cameltooling.idea.service.CamelCatalogService in project camel-idea-plugin by camel-tooling.
the class CamelDebuggerRunner method checkConfiguration.
private void checkConfiguration(@NotNull Module module) {
String currentVersion = null;
CamelService camelService = module.getProject().getService(CamelService.class);
if (camelService != null) {
CamelCatalogService camelCatalogService = module.getProject().getService(CamelCatalogService.class);
if (camelCatalogService != null) {
currentVersion = camelCatalogService.get().getLoadedVersion();
ComparableVersion version = new ComparableVersion(currentVersion);
if (version.compareTo(new ComparableVersion(MIN_CAMEL_VERSION)) < 0) {
// This is an older version of Camel, debugger is not supported
NotificationGroupManager.getInstance().getNotificationGroup("Debugger messages").createNotification("Camel version is " + version + ". Minimum required version for debugger is 3.15.0", MessageType.WARNING).notify(module.getProject());
}
}
}
List<OrderEntry> entries = Arrays.asList(ModuleRootManager.getInstance(module).getOrderEntries());
long debuggerDependenciesCount = entries.stream().filter(entry -> isDebuggerDependency(entry)).count();
if (debuggerDependenciesCount <= 0) {
NotificationGroupManager.getInstance().getNotificationGroup("Debugger messages").createNotification("Camel Debugger is not found in classpath. \nPlease add camel-debug or camel-debug-starter" + " JAR to your project dependencies.", MessageType.WARNING).notify(module.getProject());
}
}
Aggregations