Pom.xml
<profile>
<!-- Production mode is activated using -Pproduction -->
<id>production</id>
<properties>
<toto>coucou</toto>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
application.yaml
vaadin:
productionMode: ${toto}
命令
mvn clean package -Pproduction
结果:cat target/classes/application.yaml
vaadin:
productionMode: ${toto}
解决方案是application.yaml中的@toto@