From 38495b0353f30e84fbb6c329bf87254195bc794b Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Wed, 3 Aug 2016 18:32:29 -0800 Subject: [PATCH] Don't add test-classes to the classpath if not building tests. Fixes https://github.com/cbeust/kobalt/issues/214 --- .../src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt index 236340c4..4f005fe0 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt @@ -194,7 +194,7 @@ class DependencyManager @Inject constructor(val executors: KobaltExecutors, val project.dependsOn.forEach { p -> maybeAddClassDir(KFiles.joinDir(p.directory, p.classesDir(context))) - maybeAddClassDir(KFiles.makeOutputTestDir(project).path) + if (scopeFilters.contains(Scope.TEST)) maybeAddClassDir(KFiles.makeOutputTestDir(project).path) val otherDependencies = calculateDependencies(p, context, scopeFilters) result.addAll(otherDependencies)