繁体   English   中英

如何在Play Framework 2.2中自定义unmanagedResourceDirectories和excludeFilter?

[英]How to customize unmanagedResourceDirectories and excludeFilter in Play Framework 2.2?

我正在根据指南将MyBatis与Play Framework 2.2集成在一起。 本指南是针对使用project/Build.scala而不是build.sbt Play v2.1.x 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"

空白行是必需的!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM