diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Filters.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Filters.kt index 6af9cb27..d4409b03 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Filters.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Filters.kt @@ -1,6 +1,8 @@ package com.beust.kobalt.maven.aether +import com.beust.kobalt.misc.kobaltLog import org.eclipse.aether.graph.DependencyFilter +import org.eclipse.aether.graph.DependencyNode import org.eclipse.aether.util.artifact.JavaScopes object Filters { @@ -9,7 +11,15 @@ object Filters { } val TEST_FILTER = DependencyFilter { p0, p1 -> p0.dependency.scope == JavaScopes.TEST } - val EXCLUDE_OPTIONAL_FILTER = DependencyFilter { p0, p1 -> - p0.dependency != null && ! p0.dependency.optional + val EXCLUDE_OPTIONAL_FILTER = object: DependencyFilter { + override fun accept(p0: DependencyNode, p1: MutableList): Boolean { + val result = p0.dependency != null && ! p0.dependency.optional + if (! result) { + kobaltLog(2, "Excluding from optional filter: $p0") + } + return result + } + + override fun toString() = "EXCLUDE_OPTIONAL_FILTER" } }