@Nonnull
    public static List<MavenDependency> listDependencies(final Element mavenSpyLogs,
                                                         final Logger logger) {

        final List<MavenDependency> result = new ArrayList<>();

        for (final Element dependencyResolutionResult : XmlUtils.getChildrenElements(mavenSpyLogs,
                "DependencyResolutionResult")) {
            final Element resolvedDependenciesElt = XmlUtils.getUniqueChildElementOrNull(
                    dependencyResolutionResult, "resolvedDependencies");

            if (resolvedDependenciesElt == null) {
                continue;
            }

            for (final Element dependencyElt : XmlUtils.getChildrenElements(resolvedDependenciesElt,
                    "dependency")) {
                final MavenDependency dependencyArtifact = XmlUtils.newMavenDependency(
                        dependencyElt);

                final Element fileElt = XmlUtils.getUniqueChildElementOrNull(dependencyElt, "file");
                if (fileElt == null || fileElt.getTextContent() == null
                        || fileElt.getTextContent().isEmpty()) {
                    logger.log(Level.WARNING, "listDependencies: no associated file found for "
                            + dependencyArtifact + " in " + XmlUtils.toString(dependencyElt));
                } else {
                    dependencyArtifact.setFile(StringUtils.trim(fileElt.getTextContent()));
                }

                result.add(dependencyArtifact);
            }
        }

        return result;
    }
@ Nonnull public static List < MavenDependency > listDependencies ( final Element mavenSpyLogs , final Logger logger ) { final List < MavenDependency > result = new ArrayList < > ( ) ; for ( final Element dependencyResolutionResult : XmlUtils . getChildrenElements ( mavenSpyLogs , "DependencyResolutionResult" ) ) { final Element resolvedDependenciesElt = XmlUtils . getUniqueChildElementOrNull ( dependencyResolutionResult , "resolvedDependencies" ) ; if ( resolvedDependenciesElt == null ) { continue ; } for ( final Element dependencyElt : XmlUtils . getChildrenElements ( resolvedDependenciesElt , "dependency" ) ) { final MavenDependency dependencyArtifact = XmlUtils . newMavenDependency ( dependencyElt ) ; final Element fileElt = XmlUtils . getUniqueChildElementOrNull ( dependencyElt , "file" ) ; if ( fileElt == null || fileElt . getTextContent ( ) == null || fileElt . getTextContent ( ) . isEmpty ( ) ) { logger . log ( Level . WARNING , "listDependencies: no associated file found for " + dependencyArtifact + " in " + XmlUtils . toString ( dependencyElt ) ) ; } else { dependencyArtifact . setFile ( StringUtils . trim ( fileElt . getTextContent ( ) ) ) ; } result . add ( dependencyArtifact ) ; } } return result ; }
@param mavenSpyLogs Root XML element
@return list of {@link MavenArtifact}