1

我得到了带有 pom.xml 的 maven 项目,其中我根据配置文件替换了一个配置文件中的占位符,如下所示:

<properties>
        <mq-server.host>127.0.0.1</mq-server.host>
    </properties>
    <build>
        <resources>
            <resource>
                <directory>src/main/resources/config</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>
    <profiles>
        <profile>
            <id>staging</id>
            <properties>
                <mq-server.host>local.staging.com</mq-server.host>
            </properties>
        </profile>
    </profiles>

另一方面,当我使用 maven 构建项目时一切正常,我的项目是通过 eclipse 插件与本地 tomcat 同步的 Web 项目,当我使用 eclipse 中的“播放”按钮在 tomcat 上运行项目时,占位符没有被更改。我想知道如何在不为开发人员添加特殊文件的情况下修复它。

4

0 回答 0