如果您在pom.xml中创建了maven配置文件,您应该能够在Intellij Idea的右侧看到这些配置文件。 如果有多个配置文件,您可以将其中一个设为默认配置文件。 <activation> <activeByDefault>true</activeByDefault> </activation> 或者,我们可以选择运行特定的配置文件:mvn install -Pbuild-profile