@Override public boolean isInstalled() { if (this.applicationModules == null) { this.applicationModules = (List<Pom>) typeLocationService.getModules(ModuleFeatureName.APPLICATION); } // Look if the Guava dependency has been installed for (Pom module : applicationModules) { if (module.hasDependencyExcludingVersion(GUAVA_DEPENDENCY)) { return true; } } return false; }
private Collection<Pom> getValidModules(String optionContext) { if (optionContext != null) { final Matcher matcher = pattern.matcher(optionContext); if (matcher.find()) { ModuleFeatureName moduleFeatureName = ModuleFeatureName.valueOf(matcher.group(1)); return typeLocationService.getModules(moduleFeatureName); } } return projectOperations.getPoms(); }
List<Pom> modules = (List<Pom>) typeLocationService.getModules(moduleFeatureName); if (modules.size() == 0) { throw new RuntimeException(String.format("ERROR: Not exists a module with %s feature",
/** * This method check if the provided element is located in an application * module or not * * @param type */ private boolean isLocatedInApplicationModule(JavaType type) { if (type == null) { return false; } else if ("".equals(type.getModule())) { return true; } else { String moduleName = type.getModule(); // Getting all application modules Collection<Pom> modules = getTypeLocationService().getModules(ModuleFeatureName.APPLICATION); for (Pom pom : modules) { if (pom.getModuleName().equals(moduleName)) { return true; } } } return false; }
if (module == null) { Collection<Pom> applicationModules = getTypeLocationService().getModules(ModuleFeatureName.APPLICATION); if (applicationModules.size() == 1) { module = applicationModules.iterator().next();
@Override public void setup(String profile) { if (this.applicationModules == null) { this.applicationModules = (List<Pom>) typeLocationService.getModules(ModuleFeatureName.APPLICATION); } // Add Guava dependency to each application module for (Pom module : applicationModules) { projectOperations.addDependency(module.getModuleName(), GUAVA_DEPENDENCY); // Add Guava specific application properties applicationConfigService.addProperty(module.getModuleName(), CACHE_TYPE_PROPERTY_KEY, CACHE_TYPE_PROPERTY_VALUE, profile, false); applicationConfigService.addProperty(module.getModuleName(), GUAVA_CACHE_SPEC_PROPERTY_KEY, GUAVA_CACHE_SPEC_PROPERTY_VALUE, profile, false); } }
/** * This operation will check if setup operation is available * * @return true if setup operation is available. false if not. */ @Override public boolean isSetupAvailable() { Collection<Pom> applicationModules = getTypeLocationService().getModules(ModuleFeatureName.APPLICATION); boolean notInstalledInSomeModule = false; for (Pom module : applicationModules) { if (!isInstalledInModule(module.getModuleName())) { notInstalledInSomeModule = true; break; } } return getProjectOperations().isFocusedProjectAvailable() && getProjectOperations().isFeatureInstalled(FeatureNames.JPA) && notInstalledInSomeModule; }
(List<Pom>) getTypeLocationService().getModules(ModuleFeatureName.APPLICATION); if (modules.size() == 0) { throw new RuntimeException(String.format("ERROR: Not found a module with %s feature",
(List<Pom>) getTypeLocationService().getModules(ModuleFeatureName.APPLICATION); if (modules.size() == 0) { throw new RuntimeException(String.format("ERROR: Not found a module with %s feature",
Collection<Pom> modules = getTypeLocationService().getModules(ModuleFeatureName.APPLICATION); for (Pom pom : modules) { if (pom.getModuleName().equals(endpointService.getModule())) {
(List<Pom>) getTypeLocationService().getModules(ModuleFeatureName.APPLICATION); if (modules.size() == 0) { throw new RuntimeException(String.format("ERROR: Not found a module with %s feature",