[英]How to customize unmanagedResourceDirectories and excludeFilter in Play Framework 2.2?
I'm trying to integrate MyBatis with Play Framework 2.2 according to the guide . 我正在根据指南将MyBatis与Play Framework 2.2集成在一起。 This guide is written for Play v2.1.x that uses
project/Build.scala
instead of build.sbt
. 本指南是针对使用
project/Build.scala
而不是build.sbt
Play v2.1.x build.sbt
。
How can I add mapper xml files to classpath in this case? 在这种情况下,如何将mapper xml文件添加到classpath?
Excerpt from the configuration used in article below: 摘自以下文章中使用的配置:
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"
)
Settings just go in the build.sbt
file with an extra newline in between them instead of the comma, so: 设置只是在
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"
The blank line is required! 空白行是必需的!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.