当我使用 eclipse wtp 部署 webapp 时,pom.xml 中指定的自定义“webxml”文件不会作为 'web.xml' 复制到 WEB-INF 文件夹。但是,该文件在 WEB-INF 文件夹中的战争中被正确复制。
这是 pom.xml 的片段
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webXml>${webXmlPath}</webXml>
<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
</configuration>
</plugin>
${webXmlPath} 取决于配置文件并具有默认值:
<properties>
<webXmlPath>${basedir}/src/main/webapp/WEB-INF/web-embed.xml</webXmlPath>
</properties>
谢谢 :)