diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/JarGenerator.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/JarGenerator.kt index 39c4c2e1..59f51deb 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/JarGenerator.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/JarGenerator.kt @@ -107,7 +107,7 @@ class JarGenerator @Inject constructor(val dependencyManager: DependencyManager) if (! seen.contains(file.path)) { seen.add(file.path) if (! KFiles.Companion.isExcluded(file, jar.excludes)) { - result.add(IncludedFile(specs = arrayListOf(IFileSpec.FileSpec(file.path)), + result.add(IncludedFile(specs = arrayListOf(IFileSpec.FileSpec(file.absolutePath)), expandJarFiles = true)) } } diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/JarUtils.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/JarUtils.kt index dfd8cc70..fedac00f 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/JarUtils.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/JarUtils.kt @@ -47,12 +47,12 @@ public class JarUtils { throw AssertionError("File should exist: $localFile") } - if (foundFile.isDirectory) { + if (localFile.isDirectory) { log(2, "Writing contents of directory $foundFile") // Directory - val includedFile = IncludedFile(From(foundFile.path), To(""), listOf(IFileSpec.GlobSpec("**"))) - addSingleFile(".", includedFile, outputStream, expandJarFiles) + val includedFile = IncludedFile(From(""), To(""), listOf(IFileSpec.GlobSpec("**"))) + addSingleFile(localFile.path, includedFile, outputStream, expandJarFiles) } else { if (file.expandJarFiles && foundFile.name.endsWith(".jar") && ! file.from.contains("resources")) { log(2, "Writing contents of jar file $foundFile")