【问题标题】:Format for specifying multiple custom modules in PlayFramework在 PlayFramework 中指定多个自定义模块的格式
【发布时间】:2016-07-05 12:48:46
【问题描述】:

我有一个 PlayFramework 应用程序,其中有多个我想通过 application.conf 加载的自定义模块。我不确定指定它的确切语法是什么。我试过了:

enabled += [com.somemodule, com.othermodule]

enabled += ["com.somemodule","com.othermodule"]

但两者都不起作用。指定模块列表的格式是什么?

【问题讨论】:

标签: playframework playframework-2.5 typesafe-config


【解决方案1】:

只需为每个模块添加一行:

play.modules.enabled += "com.acme.SomeModule"
play.modules.enabled += "com.acme.OtherModule"

HOCONappend an array to another 的语法,但我不推荐它:

play.modules.enabled = ${?play.modules.enabled} [ "com.acme.SomeModule", "com.acme.OtherModule" ]

【讨论】:

  • 基本上这两个选项是相同的。这是一个品味问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-10-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多