我正在尝试根据指南将 MyBatis 与 Play Framework 2.2 集成。本指南是为 Play v2.1.x 编写的,它使用project/Build.scala
而不是build.sbt
.
在这种情况下,如何将映射器 xml 文件添加到类路径?
以下文章中使用的配置摘录:
val main = play.Project(appName, appVersion, appDependencies).settings(
// Add app folder as resource directory so that mapper xml files are in the classpath
unmanagedResourceDirectories in Compile <+= baseDirectory( _ / "app" ),
// but filter out java and html files that would then also be copied to the classpath
excludeFilter in Compile in unmanagedResources := "*.java" || "*.html"
)