在多模块 Maven 项目中,将跨不同模块使用的属性文件放在哪里?
我已经使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有一个父项目,这将是最好的地方。
否则是一个被其他模块包含的模块。
将
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