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 93d997ed..8bda7d28 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 @@ -208,9 +208,13 @@ class DependencyManager @Inject constructor(val executors: KobaltExecutors, val // Make sure that classes/ and test-classes/ are always at the top of this classpath, // so that older versions of that project on the classpath don't shadow them - val result = listOf(FileDependency(KFiles.makeOutputDir(project).absolutePath), - FileDependency(KFiles.makeOutputTestDir(project).absolutePath)) + - reorderDependencies(transitive) + val result : ArrayList = + arrayListOf(FileDependency(KFiles.makeOutputDir(project).absolutePath)) + if (isTest) { + result.add(FileDependency(KFiles.makeOutputTestDir(project).absolutePath)) + } + result.addAll(reorderDependencies(transitive)) + return result }