diff --git a/plugins/package-managers/sbt/src/main/kotlin/Sbt.kt b/plugins/package-managers/sbt/src/main/kotlin/Sbt.kt index f81c30f42b852..042fe33961ef9 100644 --- a/plugins/package-managers/sbt/src/main/kotlin/Sbt.kt +++ b/plugins/package-managers/sbt/src/main/kotlin/Sbt.kt @@ -238,7 +238,7 @@ class Sbt( } private fun moveGeneratedPom(pomFile: File): Result { - val targetDirParent = pomFile.absoluteFile.parentFile.searchUpwardsForSubdirectory("target") + val targetDirParent = pomFile.parentFile.searchUpwardsForSubdirectory("target") ?: return Result.failure(IllegalArgumentException("No target subdirectory found for '$pomFile'.")) val targetFilename = pomFile.relativeTo(targetDirParent).invariantSeparatorsPath.replace('/', '-') val targetFile = targetDirParent.resolve(targetFilename)