如何使用 Play Framework 安装多个模块并设置依赖关系

发布于 2024-12-04 00:58:41 字数 1015 浏览 1 评论 0原文

我正在尝试在我的应用程序中安装 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魔法少女 2024-12-11 00:58:41

您只需在 dependency.yml 文件中添加以下内容并在应用程序根文件夹中运行 play dependency 即可。

require:
    - play -> log4play 0.5
    - play -> betterlogs 1.0

You just need to add the following in dependencies.yml file and run play dependencies in your application root folder.

require:
    - play -> log4play 0.5
    - play -> betterlogs 1.0
嗫嚅 2024-12-11 00:58:41

您可以使用以下内容在项目创建时处理大量依赖项处理(来自 我应该如何声明和导出模块?):

play new myapp --with module1,module2,etc
play dependencies

这是假设您已经 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?):

play new myapp --with module1,module2,etc
play dependencies

This is assuming you've already play installed the modules you need.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文