intellij idea - spring-boot-maven-plugin reverts the property files after run -


this build configuration of project in pom.xml, when pack project, property files changed selected profile properties, when run project using maven-boot-plugin:run in intellij idea, property files changed old style , database connection raises exception. example normal application.properties has below key :

spring.datasource.url=${datasourceurl} 

and after packing project :

spring.datasource.url=url1 

but after running spring boot plugin property files changed first style.

<profiles>     <profile>         <id>live</id>         <properties>             <datasourceurl>url1</datasourceurl>         </properties>     </profile>      <profile>         <id>test</id>         <properties>             <datasourceurl>url2</datasourceurl>         </properties>     </profile> </profiles>   <build>     <defaultgoal>install</defaultgoal>     <resources>         <resource>             <directory>${basedir}/src/main/resources</directory>             <filtering>true</filtering>             <includes>                 <include>**/*.*</include>              </includes>         </resource>     </resources>     <plugins>         <plugin>             <groupid>org.apache.maven.plugins</groupid>             <artifactid>maven-resources-plugin</artifactid>             <version>2.3</version>             <configuration>                 <encoding>utf-8</encoding>             </configuration>             <executions>                 <execution>                     <id>run</id>                     <phase>package</phase>                     <goals>                         <goal>resources</goal>                     </goals>                 </execution>             </executions>         </plugin>         <plugin>             <groupid>org.springframework.boot</groupid>             <artifactid>spring-boot-maven-plugin</artifactid>              <executions>                 <execution>                     <id>repack</id>                     <phase>package</phase>                     <goals>                         <goal>repackage</goal>                     </goals>                 </execution>             </executions>         </plugin>         <plugin>             <groupid>org.apache.maven.plugins</groupid>             <artifactid>maven-dependency-plugin</artifactid>             <executions>                 <execution>                     <id>unpack</id>                     <phase>generate-resources</phase>                     <goals>                         <goal>unpack</goal>                     </goals>                     <configuration>                         <artifactitems>                             <artifactitem>                                 mywar                                  <type>war</type>                                 <overwrite>false</overwrite>                                 <outputdirectory>${project.build.directory}/classes/static/</outputdirectory>                                 <includes>**/*</includes>                             </artifactitem>                         </artifactitems>                     </configuration>                 </execution>             </executions>         </plugin>     </plugins> </build> 


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -