Search in sources :

Example 1 with Profile

use of org.sonar.maven.model.maven2.Profile in project sonar-java by SonarSource.

the class MavenDependencyCollector method fromProfiles.

private static List<Dependency> fromProfiles(@Nullable Profiles profiles) {
    if (profiles != null) {
        List<Dependency> results = new LinkedList<>();
        for (Profile profile : profiles.getProfiles()) {
            results.addAll(fromDependencyManagement(profile.getDependencyManagement()));
            results.addAll(profile.getDependencies() != null ? profile.getDependencies().getDependencies() : Collections.<Dependency>emptyList());
            results.addAll(fromBuild(profile.getBuild()));
        }
        return results;
    }
    return Collections.<Dependency>emptyList();
}
Also used : Dependency(org.sonar.maven.model.maven2.Dependency) LinkedList(java.util.LinkedList) Profile(org.sonar.maven.model.maven2.Profile)

Aggregations

LinkedList (java.util.LinkedList)1 Dependency (org.sonar.maven.model.maven2.Dependency)1 Profile (org.sonar.maven.model.maven2.Profile)1