In Maven how to exclude resources from the generated jar?

后端 未结 8 1154
余生分开走
余生分开走 2020-11-30 01:46

When I create an executable jar with dependencies (using this guide), all properties files are packaged into that jar too. How to stop it from happening? Thanks.

UPD

8条回答
  •  心在旅途
    2020-11-30 02:02

    When I create an executable jar with dependencies (using this guide), all properties files are packaged into that jar too. How to stop it from happening? Thanks.

    Properties files from where? Your main jar? Dependencies?

    In the former case, putting resources under src/test/resources as suggested is probably the most straight forward and simplest option.

    In the later case, you'll have to create a custom assembly descriptor with special excludes/exclude in the unpackOptions.

提交回复
热议问题