首页 > 解决方案 > 警告无法激活请求的配置文件“本地”

问题描述

我尝试在命令行中执行“mvn”命令,它似乎工作正常,因为 /target 中的输出是正确的。
    mvn -P dev clean package -DskipTests
但是下面的警告会在最后一行连续打印。
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  1.344 s
    [INFO] Finished at: 2021-10-07T14:22:17+09:00
    [INFO] ------------------------------------------------------------------------
    [WARNING] The requested profile "local" could not be activated because it does not exist.

我显然将配置文件选项声明为“dev”,但是这个警告说请求的配置文件是“本地的”。
为什么此警告一直显示以及如何消失?
这是我在 pom.xml 中的个人资料设置

    <profiles>
        <profile>
            <id>dev</id>
            <properties>
                <env>dev</env>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>real</id>
            <properties>
                <env>real</env>
            </properties>
        </profile>
    </profiles>

标签: maven

解决方案


推荐阅读