如何使用 Play Framework 安装多个模块并设置依赖关系
我正在尝试在我的应用程序中安装 BetterLogs 和 log4Play 模块。 Log4Play 似乎可以在 Chrome 中工作,但我似乎无法用更好的日志来增强日志。 我使用以下内容安装/配置了模块:
play install betterlogs play install log4play
将其添加到 dependency.yml
require: - play -> log4play 0.5 - play -> betterlogs 1.0
并将其添加到我的 application.conf
module.log4play=${play.path}/modules/log4play-0.5 module.betterlogs=${play.path}/modules/betterlogs-1.0 betterlogs.prefix=[%relativeFile:%line] %method() ::
我在依赖项声明中做错了什么吗?
更新:通过执行以下操作进行修复:
- 从 application.conf 中删除模块条目
- ,使用以下 dependentecies.yml 运行 play 依赖项
require:
- play -> log4play 0.5
- play -> betterlogs 1.0
- provided -> mylib 1.0
repositories:
- provided:
type: local
artifact: "${application.path}/jar/[module]-[revision].jar"
contains:
- provided -> *
- play clean
- play eclipsify -deps
I am trying to install BetterLogs and log4Play modules in my application.
Log4Play seems to work in chrome but I don't seem to be able to enhance the logs with better logs.
I installed/configured the modules with the following:
play install betterlogs play install log4play
Added this to the dependencies.yml
require: - play -> log4play 0.5 - play -> betterlogs 1.0
and this to my application.conf
module.log4play=${play.path}/modules/log4play-0.5 module.betterlogs=${play.path}/modules/betterlogs-1.0 betterlogs.prefix=[%relativeFile:%line] %method() ::
Am I doing something wrong in the dependency declaration?
Update: Fixed by doing the following:
- removed the modules entries from the application.conf
- ran play dependencies with the following dependecies.yml
require:
- play -> log4play 0.5
- play -> betterlogs 1.0
- provided -> mylib 1.0
repositories:
- provided:
type: local
artifact: "${application.path}/jar/[module]-[revision].jar"
contains:
- provided -> *
- play clean
- play eclipsify -deps
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您只需在 dependency.yml 文件中添加以下内容并在应用程序根文件夹中运行
play dependency
即可。You just need to add the following in dependencies.yml file and run
play dependencies
in your application root folder.您可以使用以下内容在项目创建时处理大量依赖项处理(来自 我应该如何声明和导出模块?):
这是假设您已经
play install
了您的模块 需要。You can take care of a lot of the dependency handling at project creation with the following (from How should I be declaring and exporting modules?):
This is assuming you've already
play install
ed the modules you need.