private Optional<Module> getModuleIfPomHasChanges(final Path pomPath, final POM pom) { POM load = load(pomPath); if (!load.equals(pom)) { return Optional.of(moduleService.resolveModule(pomPath)); } else { return Optional.empty(); } }
private Optional<Module> getModuleIfPomHasChanges(final Path pomPath, final POM pom) { POM load = load(pomPath); if (!load.equals(pom)) { return Optional.of(moduleService.resolveModule(pomPath)); } else { return Optional.empty(); } }
private void saveGAVChange(final GAV gav, final String childModuleName) throws IOException, XmlPullParserException { final org.uberfire.java.nio.file.Path childPOMPath = Paths.convert(pomPath).getParent().resolve(childModuleName).resolve("pom.xml"); if (ioService.exists(childPOMPath)) { final POM childContent = load(Paths.convert(childPOMPath)); if (childContent != null) { childContent.setParent(gav); childContent.getGav().setGroupId(gav.getGroupId()); childContent.getGav().setVersion(gav.getVersion()); savePOM(Paths.convert(childPOMPath), childContent, null); } } } }
private void saveGAVChange(final GAV gav, final String childModuleName) throws IOException, XmlPullParserException { final org.uberfire.java.nio.file.Path childPOMPath = Paths.convert(pomPath).getParent().resolve(childModuleName).resolve("pom.xml"); if (ioService.exists(childPOMPath)) { final POM childContent = load(Paths.convert(childPOMPath)); if (childContent != null) { childContent.setParent(gav); childContent.getGav().setGroupId(gav.getGroupId()); childContent.getGav().setVersion(gav.getVersion()); savePOM(Paths.convert(childPOMPath), childContent, null); } } } }
private void saveSubModules(final Path path, final POM content, final boolean updateModules) throws IOException, XmlPullParserException { if (updateModules && content.isMultiModule() && content.getModules() != null) { for (String module : content.getModules()) { org.uberfire.java.nio.file.Path childPath = Paths.convert(path).getParent().resolve(module).resolve("pom.xml"); if (ioService.exists(childPath)) { POM child = load(Paths.convert(childPath)); if (child != null) { child.setParent(content.getGav()); child.getGav().setGroupId(content.getGav().getGroupId()); child.getGav().setVersion(content.getGav().getVersion()); save(Paths.convert(childPath), child); } } } } }