我正在根据指南将MyBatis与Play Framework 2.2集成在一起。本指南是为Play v2.1.x编写的,该指南使用project/Build.scala
代替build.sbt
。
在这种情况下,如何将mapper xml文件添加到classpath?
摘录自以下文章中使用的配置:
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"
)
设置只是放在build.sbt
文件中,并且在它们之间有一个额外的换行符,而不是逗号,因此:
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"
空行是必需的!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句