Maven - Exclude certain resource files into WAR from the default src/main/resources location -
currently, want exclude files default src/main/resources folder war when packaging
i tried using maven-war-plugin following configuration failed.
<webresources> <resource> <directory>src/main/resources</directory> <targetpath>web-inf/classes</targetpath> <excludes> <exclude>*.xml</exclude> </excludes> </resource> </webresources>
...web-inf/classes still contain xml files.
how so?
as pointed out in https://stackoverflow.com/a/2737635/722997, quick way exclude files war package exclude them in build->resources
section, like:
<build> <resources> <resource> <directory>src/main/resources</directory> <excludes> <exclude>*.xml</exclude> </excludes> </resource> </resources> ... </build>
note: take account following configuration affect default executions of maven (war package, jar package, ...), not assemblies or other user configurations.
Comments
Post a Comment