We've been using war:exploded
for a while now and I'm trying to do away with it. I've added the following to my pom:
<resource>
<directory>src/main/webapp</directory>
</resource>
This copies files such as the in src/main/webapp/keystore
into target/classes/keystore
so my local UI launcher works and sees everything. Score!
However, by adding to the resources list, this means that the same files also show up in the war
file as keystore
(correct) and WEB-INF/classes/keystore
(wrong). It also means there there is a WEB-INF/classes/WEB-INF
directory (blah). I'm trying to exclude the resource files from src/main/webapp
resource since src/main/webapp/WEB-INF
is already a resource.
I'm trying not to specifically exclude keystore
and other files since we add/delete from that list semi-often. I've tried to add the following (and a number of other variants) to the war plugin configuration without results:
<webResources>
<resource>
<directory>src/main/webapp</directory>
<excludes>
<exclude>**</exclude>
</excludes>
</resource>
</webResources>
I've also read a number of other SO questions and I've spent at least an hour reading docs on from the maven war plugin page and tried other configs without success.
Any idea what magic I need to do here? Thanks in advance.
warSourceExcludes worked for me. for example.To exclude js folder and scss folder from my war i tried...
<configuration>
<warSourceExcludes>js/*.*,scss/*.*</warSourceExcludes>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<filtering>true</filtering>
<includes>
<include>WEB-INF/web.xml</include>
</includes>
</resource>
</webResources>
</configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With