首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Play Framework2.2中自定义unmanagedResourceDirectories和excludeFilter?

如何在Play Framework2.2中自定义unmanagedResourceDirectories和excludeFilter?
EN

Stack Overflow用户
提问于 2013-11-03 14:39:59
回答 1查看 2.6K关注 0票数 2

根据MyBatis,我正在尝试将指南与Play Framework2.2集成起来。本指南是为使用project/Build.scala而不是build.sbt的Play 2.1.x编写的。

在这种情况下,如何将映射xml文件添加到类路径中?

以下文章中使用的配置摘录如下:

代码语言:javascript
复制
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"
)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-03 14:47:17

设置只需在build.sbt文件中插入额外的换行符,而不是逗号,因此:

代码语言:javascript
复制
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"

需要空白行!

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19754106

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档