*
spring Preparing profiles for different environments

*
application.properties File configuration

*
pom file
<!-- Configuration environment profile--> <profiles> <!--dev Default activation , use idea Spring Boot
Configure startup project , need dev Configuration of --> <profile> <id>dev</id> <properties>
<profileActive>dev</profileActive> </properties> <activation>
<activeByDefault>true</activeByDefault> </activation> </profile> <profile>
<id>test</id> <properties> <profileActive>test</profileActive> </properties>
</profile> <profile> <id>prod</id> <properties>
<profileActive>prod</profileActive> </properties> </profile> </profiles>
<build> <finalName>${project.artifactId}</finalName> <resources> <resource>
<directory>src/main/resources</directory> <filtering>true</filtering>
<excludes> <exclude>**/*</exclude> </excludes> </resource> <resource>
<directory>src/main/resources</directory> <filtering>true</filtering>
<includes> <include>application.properties</include>
<include>application-${profileActive}.properties</include> </includes>
</resource> </resources> <plugins> <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!--
start to fight @SpringBootApplication annotation Path to startup file -->
<mainClass>xx.xx.xx.Application</mainClass> </configuration> </plugin>
</plugins> </build>
* Maven Pack and go command mvn clean install package -Dmaven.test.skip=true -Ptest -P hinder
test It's the one configured above <profileActive> Property value So it can be used smoothly , Use different profiles in different environments .

Technology
©2019-2020 Toolsou All rights reserved,
Solve in servlet The Chinese output in is a question mark C String function and character function in language MySQL management 35 A small coup optimization Java performance —— Concise article Seven sorting algorithms (java code ) use Ansible Batch deployment SSH Password free login to remote host according to excel generate create Build table SQL sentence Spring Source code series ( sixteen )Spring merge BeanDefinition Principle of Virtual machine installation Linux course What are the common exception classes ?