开发者

Maven: Having trouble excluding files from WAR

开发者 https://www.devze.com 2023-01-18 11:47 出处:网络
I have an images folder at src/main/webap/images which I\'d like to exclude from my war. Here is my war plugin confi开发者_如何学运维guration:

I have an images folder at src/main/webap/images which I'd like to exclude from my war. Here is my war plugin confi开发者_如何学运维guration:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <configuration>
      <version>2.0</version>
      <warName>UNAB</warName>
      <webXml>src/main/webapp/WEB-INF/web.xml</webXml>
      <webResources>
       <resource>
          <directory>src/main/webapp/</directory>
          <excludes>
            <exclude>images/*</exclude>
          </excludes>
        </resource>
      </webResources>
    </configuration>
  </plugin>

This isn't working. The images folder winds up in the war. Any troubleshooting tips for me?


Try using <warSourceExcludes> instead of <webResources>; I had the same problem days ago and this worked for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消