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 7fef033f..1ea41147 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 @@ -205,12 +205,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 : ArrayList = - arrayListOf(FileDependency(KFiles.makeOutputDir(project).absolutePath)) - if (isTest) { - result.add(FileDependency(KFiles.makeOutputTestDir(project).absolutePath)) + val result = arrayListOf().apply { + if (isTest) { + add(FileDependency(KFiles.makeOutputDir(project).absolutePath)) + add(FileDependency(KFiles.makeOutputTestDir(project).absolutePath)) + } + addAll(reorderDependencies(transitive)) } - result.addAll(reorderDependencies(transitive)) return result }