diff --git a/librarymanagement/src/main/scala/sbt/librarymanagement/IvyInterface.scala b/librarymanagement/src/main/scala/sbt/librarymanagement/IvyInterface.scala
index 62842755e..ed99f6bd1 100644
--- a/librarymanagement/src/main/scala/sbt/librarymanagement/IvyInterface.scala
+++ b/librarymanagement/src/main/scala/sbt/librarymanagement/IvyInterface.scala
@@ -27,10 +27,17 @@ final case class ScmInfo(browseUrl: URL, connection: String, devConnection: Opti
final case class Developer(id: String, name: String, email: String, url: URL)
-/** Rule to exclude unwanted dependencies pulled in transitively by a module. */
-final case class ExclusionRule(organization: String = "*", name: String = "*", artifact: String = "*", configurations: Seq[String] = Nil)
-object ExclusionRule {
- implicit val pickler: Pickler[ExclusionRule] with Unpickler[ExclusionRule] = PicklerUnpickler.generate[ExclusionRule]
+/** Rule to either:
+ *
+ * - exclude unwanted dependencies pulled in transitively by a module, or to
+ * - include and merge artifacts coming from the ModuleDescriptor if "dependencyArtifacts" are also provided.
+ *
+ * Which one depends on the parameter name which it is passed to, but the filter has the same fields in both cases. */
+final case class InclExclRule(organization: String = "*", name: String = "*", artifact: String = "*", configurations: Seq[String] = Nil)
+object InclExclRule {
+ def everything = InclExclRule("*", "*", "*", Nil)
+
+ implicit val pickler: Pickler[InclExclRule] with Unpickler[InclExclRule] = PicklerUnpickler.generate[InclExclRule]
}
/** Work around the inadequacy of Ivy's ArtifactTypeFilter (that it cannot reverse a filter)
diff --git a/librarymanagement/src/main/scala/sbt/librarymanagement/ModuleID.scala b/librarymanagement/src/main/scala/sbt/librarymanagement/ModuleID.scala
index 46b63ce39..d2071780c 100644
--- a/librarymanagement/src/main/scala/sbt/librarymanagement/ModuleID.scala
+++ b/librarymanagement/src/main/scala/sbt/librarymanagement/ModuleID.scala
@@ -70,10 +70,10 @@ final case class ModuleID(organization: String, name: String, revision: String,
* Applies the provided exclusions to dependencies of this module. Note that only exclusions that specify
* both the exact organization and name and nothing else will be included in a pom.xml.
*/
- def excludeAll(rules: ExclusionRule*) = copy(exclusions = this.exclusions ++ rules)
+ def excludeAll(rules: InclExclRule*) = copy(exclusions = this.exclusions ++ rules)
/** Excludes the dependency with organization `org` and `name` from being introduced by this dependency during resolution. */
- def exclude(org: String, name: String) = excludeAll(ExclusionRule(org, name))
+ def exclude(org: String, name: String) = excludeAll(InclExclRule(org, name))
/**
* Adds extra attributes for this module. All keys are prefixed with `e:` if they are not already so prefixed.
diff --git a/librarymanagement/src/main/scala/sbt/librarymanagement/package.scala b/librarymanagement/src/main/scala/sbt/librarymanagement/package.scala
new file mode 100644
index 000000000..24e6eee19
--- /dev/null
+++ b/librarymanagement/src/main/scala/sbt/librarymanagement/package.scala
@@ -0,0 +1,9 @@
+package sbt
+
+package object librarymanagement {
+ type ExclusionRule = InclExclRule
+ val ExclusionRule = InclExclRule
+
+ type InclusionRule = InclExclRule
+ val InclusionRule = InclExclRule
+}