In Maven how to exclude resources from the generated jar?

后端 未结 8 1155
余生分开走
余生分开走 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 01:59

    To exclude any file from a jar / target directory you can use the tag in your pom.xml file.

    In the next example, all files with .properties extension will not be included:

    
        
            
                src/main/resources
                
                    *.properties
                
                false
            
        
    
    

提交回复
热议问题