Java 如何让STS解析我在maven概要文件中定义的web.xml路径?

Java 如何让STS解析我在maven概要文件中定义的web.xml路径?,java,eclipse,spring,maven,spring-tool-suite,Java,Eclipse,Spring,Maven,Spring Tool Suite,我有一个maven项目,它有不同的开发和生产环境。web.xml中的某些部分需要在生产时删除。直到今天,有一个基于antrunner的xml任务正是这样做的。现在我想删除脚本部分,并介绍web.xml的两个版本。基本上,我会将路径“WEB-INF/WEB.xml”扩展为“WEB-INF/dev/WEB.xml”。这是在两个配置文件中配置的: <profile> <id>dev</id> <activation>

我有一个maven项目,它有不同的开发和生产环境。web.xml中的某些部分需要在生产时删除。直到今天,有一个基于antrunner的xml任务正是这样做的。现在我想删除脚本部分,并介绍web.xml的两个版本。基本上,我会将路径“WEB-INF/WEB.xml”扩展为“WEB-INF/dev/WEB.xml”。这是在两个配置文件中配置的:

    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <webxml.path>${project.basedir}/src/main/webapp/WEB-INF/dev/WEB.xml</webxml.path>
        </properties>
    </profile>

发展

当我使用上下文菜单中的“创建描述符存根”时,它甚至创建了一个名为${webxml.path}的文件,其中包含默认的web.xml内容

提供的错误消息是:

web.xml丢失,failOnMissingWebXml设置为true

如果可能的话,我不想禁用该检查(failOnMissingWebXml)

有没有办法让STS在解析变量时更加热心

更新:
在编写本文时,我发现,在从IDE构建文件时,可以使用maven resources插件将文件手动复制到相应的路径。如果m2e能够尊重war插件的属性,那就太好了。还是这根本不可能?构建过程不是由maven自己执行的吗,即使我明确指定了外部版本?

我很乐意提供帮助,但这听起来更像是Eclipse/STS中m2e和m2e wtp工具的问题,所以他们的论坛可能也会有所帮助:好的,我也会在那里询问。谢谢你的指点!
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <executions>
            <execution>
                <id>default-war</id>
                <phase>package</phase>
                <goals>
                    <goal>war</goal>
                </goals>
                <configuration>
                    <warSourceDirectory>${project.build.directory}/${project.build.finalName}</warSourceDirectory>
                    <webXml>${webxml.path}</webXml>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                    </archive>
                </configuration>
            </execution>
        </executions>
    </plugin>