maven java 配置文件路径_java – 在maven项目的路径中,我应该放置不被认为是资源的配置文件...

The question is what is the best solution of the two? If the correct is 2, what is the best way to copy it to target folder? Is there any other solution better and more common than those two?

因为你希望该文件被复制到目标/ classes文件夹,它以某种方式被认为是一个资源(所以放在src / main / resources或声明src / main / conf作为资源目录)。如果你不想在最终的jar中,请配置Maven JAR Plugin来排除它:

...

...

org.apache.maven.plugins

maven-jar-plugin

2.3.1

**/conf/*

...

...

对于汇编部分,汇编描述符非常灵活,因此应该可以实现您想要的,而不管选择。我建议使用最简单的设置。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值