mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
GITHUB-215: Bug in dependent project classpath.
Fixes https://github.com/cbeust/kobalt/issues/215
This commit is contained in:
parent
6ac16074f0
commit
f89688ae19
6 changed files with 18 additions and 34 deletions
|
@ -7,7 +7,6 @@ import com.beust.kobalt.api.annotation.Task
|
|||
import com.beust.kobalt.archive.Archives
|
||||
import com.beust.kobalt.archive.Jar
|
||||
import com.beust.kobalt.internal.ActorUtils
|
||||
import com.beust.kobalt.internal.JvmCompilerPlugin
|
||||
import com.beust.kobalt.maven.DependencyManager
|
||||
import com.beust.kobalt.misc.KFiles
|
||||
import com.beust.kobalt.misc.KobaltExecutors
|
||||
|
@ -106,12 +105,10 @@ class ApplicationPlugin @Inject constructor(val configActor: ConfigActor<Applica
|
|||
val java = JavaInfo.create(File(SystemProperties.javaBase)).javaExecutable!!
|
||||
if (! isFatJar(packages, jarName)) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val projDeps = project.projectProperties.get(JvmCompilerPlugin.DEPENDENT_PROJECTS)
|
||||
as List<ProjectDescription>
|
||||
// If the jar file is not fat, we need to add the transitive closure of all dependencies
|
||||
// on the classpath
|
||||
val allTheDependencies =
|
||||
dependencyManager.calculateDependencies(project, context, projDeps,
|
||||
dependencyManager.calculateDependencies(project, context,
|
||||
allDependencies = project.compileDependencies).map { it.jarFile.get().path }
|
||||
allDeps.addAll(allTheDependencies)
|
||||
}
|
||||
|
|
|
@ -118,8 +118,7 @@ class PackagingPlugin @Inject constructor(val dependencyManager : DependencyMana
|
|||
val analyzer = Analyzer().apply {
|
||||
jar = aQute.bnd.osgi.Jar(project.projectProperties.get(Archives.JAR_NAME) as String)
|
||||
val dependencies = project.compileDependencies + project.compileRuntimeDependencies
|
||||
val dependentProjects = project.dependentProjects
|
||||
dependencyManager.calculateDependencies(project, context, dependentProjects, dependencies).forEach {
|
||||
dependencyManager.calculateDependencies(project, context, dependencies).forEach {
|
||||
addClasspath(it.jarFile.get())
|
||||
}
|
||||
setProperty(Analyzer.BUNDLE_VERSION, project.version)
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
package com.beust.kobalt.plugin.packaging
|
||||
|
||||
import com.beust.kobalt.archive.Archives
|
||||
import com.beust.kobalt.IFileSpec
|
||||
import com.beust.kobalt.JarGenerator
|
||||
import com.beust.kobalt.archive.War
|
||||
import com.beust.kobalt.api.IClasspathDependency
|
||||
import com.beust.kobalt.api.KobaltContext
|
||||
import com.beust.kobalt.api.Project
|
||||
import com.beust.kobalt.api.ProjectDescription
|
||||
import com.beust.kobalt.archive.Archives
|
||||
import com.beust.kobalt.archive.War
|
||||
import com.beust.kobalt.maven.DependencyManager
|
||||
import com.beust.kobalt.misc.From
|
||||
import com.beust.kobalt.misc.IncludedFile
|
||||
|
@ -40,9 +39,7 @@ class WarGenerator @Inject constructor(val dependencyManager: DependencyManager)
|
|||
// The transitive closure of libraries goes into WEB-INF/libs.
|
||||
// Copy them all in kobaltBuild/war/WEB-INF/libs and create one IncludedFile out of that directory
|
||||
//
|
||||
val dependentProjects = listOf(ProjectDescription(project, project.projectExtra.dependsOn))
|
||||
val allDependencies = dependencyManager.calculateDependencies(project, context, dependentProjects,
|
||||
project.compileDependencies)
|
||||
val allDependencies = dependencyManager.calculateDependencies(project, context, project.compileDependencies)
|
||||
|
||||
val outDir = project.buildDirectory + "/war"
|
||||
val fullDir = outDir + "/" + LIB
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue