From d8cbbdc77291e620d83ea73dd3140fe0234045c8 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Mon, 16 Nov 2015 04:41:49 -0800 Subject: [PATCH] Refactoring. --- src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt | 1 + .../com/beust/kobalt/plugin/application/ApplicationPlugin.kt | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt b/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt index 8b884405..197369e1 100644 --- a/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt +++ b/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt @@ -19,6 +19,7 @@ public class DependencyManager @Inject constructor(val executors: KobaltExecutor /** * @return the classpath for this project, including the IClasspathContributors. + * allDependencies is typically either compileDependencies or testDependencies */ fun calculateDependencies(project: Project?, context: KobaltContext, dependentProjects: List = emptyList(), diff --git a/src/main/kotlin/com/beust/kobalt/plugin/application/ApplicationPlugin.kt b/src/main/kotlin/com/beust/kobalt/plugin/application/ApplicationPlugin.kt index c7b5bf70..107a0ca9 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/application/ApplicationPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/application/ApplicationPlugin.kt @@ -62,9 +62,10 @@ class ApplicationPlugin @Inject constructor(val executors: KobaltExecutors, as List // If the jar file is not fat, we need to add the transitive closure of all dependencies // on the classpath - allDeps.addAll( + val allTheDependencies = dependencyManager.calculateDependencies(project, context, projDeps, - allDependencies = project.compileDependencies).map { it.jarFile.get().path }) + allDependencies = project.compileDependencies).map { it.jarFile.get().path } + allDeps.addAll(allTheDependencies) } val allDepsJoined = allDeps.joinToString(File.pathSeparator) val args = listOf("-classpath", allDepsJoined) + config.jvmArgs + config.mainClass!!