过滤掉class文件和jar包,包含和过滤掉特定的jsp文件

maven-war-plugin插件介绍:http://maven.apache.org/plugins/maven-war-plugin/examples/including-excluding-files-from-war.html

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>3.1.0</version>
    <configuration>
     <webXml>src/main/webapp/WEB-INF/web.xml</webXml> <packagingExcludes>WEB-INF/classes/,WEB-INF/lib/</packagingExcludes> <warSourceExcludes>WEB-INF/view/hello.jsp</warSourceExcludes> <warSourceIncludes>WEB-INF/view/index.jsp</warSourceIncludes> </configuration> <executions> <execution> <id>prepare-war</id> <phase>prepare-package</phase> <goals> <goal>exploded</goal> </goals> </execution> </executions> </plugin>

添加<webXml>src/main/webapp/WEB-INF/web.xml</webXml>是因为打包时报错:

Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)

 

相关文章:

  • 2021-08-30
  • 2021-09-05
  • 2021-12-10
  • 2021-03-31
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-29
  • 2021-04-27
  • 2021-06-24
  • 2022-02-08
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
相关资源
相似解决方案