@Override
    protected boolean isWriteIgnoredElement(String element, TreePath<String> path, Dependency dependency) {
        if (path.matches("parent/relativePath")) {
            return true;
        }
        boolean ignore = super.isWriteIgnoredElement(element, path, dependency);
        if (keepAllElements || ignore) {
            return ignore;
        }
        if (keepElements.contains(element)) {
            return false;
        }
        if (path.size() > 2 && keepElements.contains(path.get(1))) {
            if ("version".equals(element)) {
                if ("plugin".equals(path.parent(1))) {
                    return true;
                }
            }
            
        }
//        if (WRITE_IGNORED_ELEMENTS.contains(element)) {
//            System.out.println("Write ignored " + element + " " + printPath(path) + " for " + dependency);
//        }
        return path.size() == 2 && WRITE_IGNORED_ELEMENTS.contains(element);
    }