...
<build>
<plugins>
...
<plugin>
<groupId>com.github.nodevops</groupId>
<artifactId>confd-maven-plugin</artifactId>
<executions>
<execution>
<!-- common step shared by all profiles that prepare the config file for further usage /-->
<id>prepare</id>
<goals>
<goal>prepare</goal>
</goals>
<configuration>
<forceDestToLocalFileSystemType>true</forceDestToLocalFileSystemType>
<templates>
<template>
<id>application.yml</id>
<src>src/main/confd/templates/application.yml.tmpl</src>
<dest>${project.basedir}/target/generated-configuration/application.yml</dest>
<keys>
<value>/your/namespace</value>
<value>/runtime</value>
</keys>
</template>
</templates>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
...
<profiles>
<profile>
<id>run-local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.nodevops</groupId>
<artifactId>confd-maven-plugin</artifactId>
<executions>
<execution>
<!-- we want to generate the config files because we need it to run now /-->
<id>generate</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<processor>
<name>java-processor</name>
</processor>
<dictionary>src/main/confd/dictionaries/local.dict</dictionary>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<arguments>
<argument>--spring.config.location=file:target/generated-configuration/application.yml
</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>delivery</id>
<build>
<plugins>
<plugin>
<groupId>com.github.nodevops</groupId>
<artifactId>confd-maven-plugin</artifactId>
<executions>
<execution>
<!-- mandatory: use the same id to get the benefit of the merge of the values with the global configuration -->
<id>prepare</id>
<goals>
<goal>prepare</goal>
</goals>
<configuration>
<forceDestToLocalFileSystemType>false</forceDestToLocalFileSystemType>
<templates>
<template>
<id>application.yml</id>
<!-- we only need to override the dest value, as long as we keep the templates in the same order as in the global config -->
<dest>/usr/local/appli/config/application.yml</dest>
</template>
</templates>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>confd</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>src/main/assembly/confd.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>