我在repo
子目录中有本地maven存储库。需要指向解析程序路径中的该目录,但下面的示例不起作用。如何在此配置中获取application path
?
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
resolvers += "my1" at "file://${Play.application().path()}/repo"
resolvers += "my2" at "file://${application.path}/repo"
resolvers += "my3" at "file://${play.application.path}/repo"
)
在控制器类中使用Play.application().path()
指向路径,而不是我需要的路径。
答案 0 :(得分:1)
在Build.scala中,项目类和设置不可用,因为它构建了play项目。但你可以使用一些SBT魔法:
val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
resolvers <+= baseDirectory { base =>
"local maven repo in project" at ("file://" + base.getAbsolutePath + "/repo")
}
)