Maven Filter不能在wtpwebapps文件夹中工作

时间:2016-09-18 15:16:06

标签: eclipse maven tomcat

我使用一些maven-filters设置生成war文件,请查看:

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.5</version>
        <configuration>
            <targetJdk>1.6</targetJdk>
        </configuration>
    </plugin>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
        </configuration>
    </plugin>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.5</version>
        <configuration>
            <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
            <escapeString>\</escapeString>
            <webResources>
                <resource>
                    <directory>src/main/webapp/WEB-INF</directory>
                    <targetPath>/WEB-INF</targetPath>
                    <filtering>true</filtering>
                    <includes>
                        <include>**/*.xml</include>
                    </includes>
                </resource>
            </webResources>
        </configuration>
    </plugin>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
            <escapeString>\</escapeString>
        </configuration>
    </plugin>

</plugins>
<resources>
    <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
    </resource>
</resources>

当我执行&#34; mvn clean install&#34;并寻找&#34;目标&#34;文件夹过滤器工作得很好,我可以将war文件上传到生产,但是如果我查看为eclipse生成的wtpwebapps文件夹,过滤器没有动作,Seens就像eclipse在maven-filter行为之前在wtpwebapps中生成了文件。

如何解决此问题并强制eclipse使用maven-filter。

0 个答案:

没有答案