refactor(extension): Maven 本地仓库路径将会相对于 DATA_ROOT 路径.

为防止混淆配置意义, 方便数据转移, 将 Maven 本地仓库路径调整为相对 DATA_ROOT 目录, 绝对路径不受影响.
This commit is contained in:
2022-04-14 22:38:51 +08:00
parent 64849adfab
commit 142eddfa28
2 changed files with 6 additions and 1 deletions

View File

@ -56,7 +56,11 @@ internal class Launcher : AutoCloseable {
private val botSessionMap = mutableMapOf<ScalaBot, BotSession>()
private val mavenLocalRepository =
if (Const.config.mavenLocalRepository != null && Const.config.mavenLocalRepository.isNotEmpty()) {
LocalRepository(Const.config.mavenLocalRepository)
val repoPath = AppPaths.DATA_ROOT.file.toPath()
.resolve(Const.config.mavenLocalRepository)
.toRealPath()
.toFile()
LocalRepository(repoPath)
} else {
LocalRepository("${System.getProperty("user.home")}/.m2/repository")
}