gpt4 book ai didi

java - 如何在 Play Framework 2.2 中自定义 unmanagedResourceDirectories 和 exceptFilter?

转载 作者:行者123 更新时间:2023-12-03 06:15:34 24 4
gpt4 key购买 nike

我正在尝试根据 guide 将 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"
)

最佳答案

设置只需放入 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"

空行是必须的!

关于java - 如何在 Play Framework 2.2 中自定义 unmanagedResourceDirectories 和 exceptFilter?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19754106/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com