class PomEditorDefault implements PomEditor {

    public boolean addDependencies(List<DynamicPomDependency> deps,
                                   Path pomPath) {
        if (deps.isEmpty()) {
            return false;
        }
        boolean result = false;
        try {
            org.uberfire.java.nio.file.Path filePath = Paths.get(pomPath.toURI());
            Model model = getPOMModel(filePath);
            Map<String, String> keys = getKeysFromDeps(model.getDependencies());

            for (DynamicPomDependency dep : deps) {
                String keyDep = getKeyFromDep(dep);
                if (!keys.containsKey(keyDep)) {
                    Dependency pomDep = getMavenDependency(dep);
                    model.getDependencies().add(pomDep);
                    result = true;
                } else {
                    //override dep version with the version contained in the json
                    List<Dependency> modelDeps = model.getDependencies();
                    for (Dependency modelDep : modelDeps) {
                        if (modelDep.getGroupId().equals(dep.getGroupID()) && modelDep.getArtifactId().equals(dep.getArtifactID()) && !modelDep.getVersion().equals(dep.getVersion())) {
                            modelDep.setVersion(dep.getVersion());
                            result = true;
                        }
                    }
                }
            }
            if (result) {
                writePOMModelOnFS(filePath,
                                  model);
            }
        } catch (Exception ex) {
            logger.error(ex.getMessage(),
                         ex);
            result = false;
        }
        return result;
    }

    public  PomEditorDefault();

}