// Path: src/main/java/com/github/ferstl/maven/pomenforcers/model/DependencyModel.java
// @XmlRootElement(name = "dependency")
// public class DependencyModel extends ArtifactModel {
// 
//   private static final Joiner TO_STRING_JOINER = Joiner.on(":").skipNulls();
// 
//   @XmlElement(namespace = "http://maven.apache.org/POM/4.0.0")
//   @XmlJavaTypeAdapter(value = DependencyScopeAdapter.class)
//   private DependencyScope scope;
// 
//   @XmlElement(namespace = "http://maven.apache.org/POM/4.0.0")
//   private String classifier;
// 
//   @XmlElement(namespace = "http://maven.apache.org/POM/4.0.0")
//   private String type;
// 
//   @XmlElementWrapper(namespace = "http://maven.apache.org/POM/4.0.0")
//   @XmlElement(name = "exclusion", namespace = "http://maven.apache.org/POM/4.0.0")
//   private List<ArtifactModel> exclusions;
// 
//   // Constructor used by JAXB
//   DependencyModel() {
//   }
// 
//   public DependencyModel(
//       String groupId, String artifactId, String version, String scope, String classifier, String type) {
// 
//     super(groupId, artifactId, version);
//     this.scope = scope != null ? DependencyScope.getByScopeName(scope) : null;
//     this.classifier = classifier;
//     this.type = type;
//   }
// 
//   public DependencyScope getScope() {
//     return this.scope != null ? this.scope : DependencyScope.COMPILE;
//   }
// 
//   public String getClassifier() {
//     return this.classifier;
//   }
// 
//   public String getType() {
//     return this.type != null ? this.type : "jar";
//   }
// 
//   public List<ArtifactModel> getExclusions() {
//     return this.exclusions != null ? this.exclusions : Collections.emptyList();
//   }
// 
//   @Override
//   public String toString() {
//     return TO_STRING_JOINER.join(
//         super.toString(),
//         getType(),
//         getScope().getScopeName(),
//         this.classifier);
//   }
// 
//   // Note that this equals() implementation breaks the symmetry contract!
//   @Override
//   public boolean equals(Object obj) {
//     if (this == obj) {
//       return true;
//     }
//     if (!(obj instanceof DependencyModel)) {
//       return false;
//     }
// 
//     DependencyModel other = (DependencyModel) obj;
//     return super.equals(other)
//         && equal(this.classifier, other.classifier)
//         && equal(this.type, other.type)
//         && equal(this.scope, other.scope)
//         && equal(this.exclusions, other.exclusions);
//   }
// 
//   @Override
//   public int hashCode() {
//     return Objects.hash(super.hashCode(), this.classifier, this.type, this.scope);
//   }
// 
// }
// 
// Path: src/main/java/com/github/ferstl/maven/pomenforcers/ErrorReport.java
// public static <T> String toList(Collection<T> collection) {
//   return toList(collection, Function.identity());
// }


import java.util.Collection;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import com.github.ferstl.maven.pomenforcers.model.DependencyModel;
import static com.github.ferstl.maven.pomenforcers.ErrorReport.toList;
   * @param manageExclusions Manage exclusion in dependency management.
   * @configParam
   * @default <code>true</code>
   * @since 1.0.0
   */
  public void setManageExclusions(boolean manageExclusions) {
    this.manageExclusions = manageExclusions;
  }

  @Override
  protected PedanticEnforcerRule getDescription() {
    return PedanticEnforcerRule.DEPENDENCY_CONFIGURATION;
  }

  @Override
  protected void accept(PedanticEnforcerVisitor visitor) {
    visitor.visit(this);
  }

  @Override
  protected void doEnforce(ErrorReport report) {
    if (this.manageVersions) {
      enforceManagedVersions(report);
    }
    if (this.manageExclusions) {
      enforceManagedExclusion(report);
    }
  }

  private void enforceManagedVersions(ErrorReport report) {
// Path: src/main/java/com/github/ferstl/maven/pomenforcers/model/DependencyModel.java
// @XmlRootElement(name = "dependency")
// public class DependencyModel extends ArtifactModel {
// 
//   private static final Joiner TO_STRING_JOINER = Joiner.on(":").skipNulls();
// 
//   @XmlElement(namespace = "http://maven.apache.org/POM/4.0.0")
//   @XmlJavaTypeAdapter(value = DependencyScopeAdapter.class)
//   private DependencyScope scope;
// 
//   @XmlElement(namespace = "http://maven.apache.org/POM/4.0.0")
//   private String classifier;
// 
//   @XmlElement(namespace = "http://maven.apache.org/POM/4.0.0")
//   private String type;
// 
//   @XmlElementWrapper(namespace = "http://maven.apache.org/POM/4.0.0")
//   @XmlElement(name = "exclusion", namespace = "http://maven.apache.org/POM/4.0.0")
//   private List<ArtifactModel> exclusions;
// 
//   // Constructor used by JAXB
//   DependencyModel() {
//   }
// 
//   public DependencyModel(
//       String groupId, String artifactId, String version, String scope, String classifier, String type) {
// 
//     super(groupId, artifactId, version);
//     this.scope = scope != null ? DependencyScope.getByScopeName(scope) : null;
//     this.classifier = classifier;
//     this.type = type;
//   }
// 
//   public DependencyScope getScope() {
//     return this.scope != null ? this.scope : DependencyScope.COMPILE;
//   }
// 
//   public String getClassifier() {
//     return this.classifier;
//   }
// 
//   public String getType() {
//     return this.type != null ? this.type : "jar";
//   }
// 
//   public List<ArtifactModel> getExclusions() {
//     return this.exclusions != null ? this.exclusions : Collections.emptyList();
//   }
// 
//   @Override
//   public String toString() {
//     return TO_STRING_JOINER.join(
//         super.toString(),
//         getType(),
//         getScope().getScopeName(),
//         this.classifier);
//   }
// 
//   // Note that this equals() implementation breaks the symmetry contract!
//   @Override
//   public boolean equals(Object obj) {
//     if (this == obj) {
//       return true;
//     }
//     if (!(obj instanceof DependencyModel)) {
//       return false;
//     }
// 
//     DependencyModel other = (DependencyModel) obj;
//     return super.equals(other)
//         && equal(this.classifier, other.classifier)
//         && equal(this.type, other.type)
//         && equal(this.scope, other.scope)
//         && equal(this.exclusions, other.exclusions);
//   }
// 
//   @Override
//   public int hashCode() {
//     return Objects.hash(super.hashCode(), this.classifier, this.type, this.scope);
//   }
// 
// }
// 
// Path: src/main/java/com/github/ferstl/maven/pomenforcers/ErrorReport.java
// public static <T> String toList(Collection<T> collection) {
//   return toList(collection, Function.identity());
// }


// Path: src/main/java/com/github/ferstl/maven/pomenforcers/PedanticDependencyConfigurationEnforcer.java
import java.util.Collection;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import com.github.ferstl.maven.pomenforcers.model.DependencyModel;
import static com.github.ferstl.maven.pomenforcers.ErrorReport.toList;

   * @param manageExclusions Manage exclusion in dependency management.
   * @configParam
   * @default <code>true</code>
   * @since 1.0.0
   */
  public void setManageExclusions(boolean manageExclusions) {
    this.manageExclusions = manageExclusions;
  }

  @Override
  protected PedanticEnforcerRule getDescription() {
    return PedanticEnforcerRule.DEPENDENCY_CONFIGURATION;
  }

  @Override
  protected void accept(PedanticEnforcerVisitor visitor) {
    visitor.visit(this);
  }

  @Override
  protected void doEnforce(ErrorReport report) {
    if (this.manageVersions) {
      enforceManagedVersions(report);
    }
    if (this.manageExclusions) {
      enforceManagedExclusion(report);
    }
  }

  private void enforceManagedVersions(ErrorReport report) {
    Collection<DependencyModel> versionedDependencies = searchForDependencies(DependencyPredicate.WITH_VERSION);