maven eclipse wtp未设置自定义<;webxml>;WEB-INF文件夹中的文件
当我使用EclipseWTP部署webapp时,pom.xml中指定的自定义“webxml”文件不会作为“WEB.xml”复制到WEB-INF文件夹。但是,该文件在war中正确复制到WEB-INF文件夹中 下面是pom.xml中的片段maven eclipse wtp未设置自定义<;webxml>;WEB-INF文件夹中的文件,maven,web.xml,eclipse-wtp,maven-war-plugin,Maven,Web.xml,Eclipse Wtp,Maven War Plugin,当我使用EclipseWTP部署webapp时,pom.xml中指定的自定义“webxml”文件不会作为“WEB.xml”复制到WEB-INF文件夹。但是,该文件在war中正确复制到WEB-INF文件夹中 下面是pom.xml中的片段 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId>
<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>
org.apache.maven.plugins
maven战争插件
2.1.1
${webXmlPath}
WEB-INF/WEB.xml
${webXmlPath}取决于配置文件,并具有默认值:
<properties>
<webXmlPath>${basedir}/src/main/webapp/WEB-INF/web-embed.xml</webXmlPath>
</properties>
${basedir}/src/main/webapp/WEB-INF/WEB-embed.xml
谢谢:)如果您使用,/.settings/org.eclipse.wst.common.component应该包含如下条目:
这应该能奏效
现在,对于支持它的服务器适配器(目前仅限于JBoss),使用WEB-INF/WEB.xml
实际上会阻止部署任何WEB.xml。其他服务器适配器(如Tomcat)将忽略该指令。这对我帮助很大。谢谢你@Fred!