在多模块 Maven 项目中,将跨不同模块使用的属性文件放在哪里?

发布于 2024-11-19 18:14:40 字数 132 浏览 3 评论 0原文

我已经使用 Maven 创建了一个不错的多模块项目,但现在我想知道存储跨模块共享的属性文件的最佳位置是什么。举个例子,我有 4 个模块都需要一个 log4j.properties 文件,我是否需要将它放在每个模块中,或者是否有一个中心位置可以放置它?

i have created a nice multi-module project using maven, but now i am wondering what the best place would be to store property files that shared accross modules. To give an example i have 4 modules all needing a log4j.properties file, do i need to put it in every module or is there a central place in which to put this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

盗心人 2024-11-26 18:14:40

如果您有一个父项目,这将是最好的地方。

否则是一个被其他模块包含的模块。

log4j.properties 放入 /src/main/resources

If you have a parent project, this would be the best place.

Otherwise a module that is included by each other module.

Put the log4j.properties into /src/main/resources

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