diff --git a/robolectric-extension/src/main/kotlin/tech/apter/junit/jupiter/robolectric/internal/JUnit5MavenDependencyResolver.kt b/robolectric-extension/src/main/kotlin/tech/apter/junit/jupiter/robolectric/internal/JUnit5MavenDependencyResolver.kt index a622ff8..47784e3 100644 --- a/robolectric-extension/src/main/kotlin/tech/apter/junit/jupiter/robolectric/internal/JUnit5MavenDependencyResolver.kt +++ b/robolectric-extension/src/main/kotlin/tech/apter/junit/jupiter/robolectric/internal/JUnit5MavenDependencyResolver.kt @@ -63,7 +63,8 @@ internal class JUnit5MavenDependencyResolver private constructor( } private fun createLockFile(dependencyJar: DependencyJar): File { - return File(System.getProperty("user.home"), "${dependencyJar.shortName}.lock") + val lockFileName = dependencyJar.shortName.replace(SPECIAL_CHARACTERS_IN_FILE_NAME_REGEX.toRegex(), "_") + return File(System.getProperty("user.home"), "$lockFileName.lock") } @Suppress("NestedBlockDepth") @@ -83,4 +84,8 @@ internal class JUnit5MavenDependencyResolver private constructor( lockFile.delete() } } + + private companion object { + private const val SPECIAL_CHARACTERS_IN_FILE_NAME_REGEX = """[<>:"\\/|\?\*]""" + } }