In Maven how to exclude resources from the generated jar?

后端 未结 8 1156
余生分开走
余生分开走 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:14

    This calls exactly for the using the Maven JAR Plugin

    For example, if you want to exclude everything under src/test/resources/ from the final jar, put this:

    
    
            
                
                
                    org.apache.maven.plugins
                    maven-jar-plugin
                    2.3.1
                    
                        
                            src/test/resources/**
                        
                    
                
    
    ...
    

    Files under src/test/resources/ will still be available on class-path, they just won't be in resulting JAR.

提交回复
热议问题