maven 隔离 --- 讲解和说明!

This commit is contained in:
qiurunze123 2018-10-27 23:40:10 +08:00
parent 87c7ac9ca9
commit d94fe1b6bf
9 changed files with 871 additions and 459 deletions

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.projectlombok:lombok:1.18.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.2/lombok-1.18.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.2/lombok-1.18.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.2/lombok-1.18.2-sources.jar!/" />
</SOURCES>
</library>
</component>

File diff suppressed because it is too large Load Diff

View File

@ -127,3 +127,12 @@ redis的数量不是库存,他的作用仅仅只是为了阻挡多余的请求
本文使用的是注解方法开发所以不做过多解释<br> 本文使用的是注解方法开发所以不做过多解释<br>
下面仔细讲解以下如何详细使用xml开发在目录里面有一个与本文无挂的类似于微信自动回复的功能br> 下面仔细讲解以下如何详细使用xml开发在目录里面有一个与本文无挂的类似于微信自动回复的功能br>
里面有mybatis的全部解析和用法,大家可以简单的当做一个demo来使用<br> 里面有mybatis的全部解析和用法,大家可以简单的当做一个demo来使用<br>
### maven 隔离
maven隔离就是在开发中把各个环境的隔离开来一般分为
本地local
开发(dev)
测试(test)
线上(prod)
在环境部署中为了防止人工修改的弊端! spring.profiles.active=@activatedProperties@

12
pom.xml
View File

@ -169,7 +169,7 @@
<directory>src/main/resources</directory> <!--这里对应项目存放配置文件的目录--> <!--开启filtering功能 --> <directory>src/main/resources</directory> <!--这里对应项目存放配置文件的目录--> <!--开启filtering功能 -->
<filtering>true</filtering> <filtering>true</filtering>
<excludes> <excludes>
<exclude>application.properties</exclude> <exclude>application-local.properties</exclude>
<exclude>application-dev.properties</exclude> <exclude>application-dev.properties</exclude>
<exclude>application-prod.properties</exclude> <exclude>application-prod.properties</exclude>
<exclude>application-test.properties</exclude> <exclude>application-test.properties</exclude>
@ -194,14 +194,20 @@
<profiles> <profiles>
<profile> <profile>
<id>dev</id> <id>local</id>
<properties> <!-- 环境标识,需要与配置文件的名称相对应 --> <properties> <!-- 环境标识,需要与配置文件的名称相对应 -->
<activatedProperties>dev</activatedProperties> <activatedProperties>local</activatedProperties>
</properties> </properties>
<activation> <!-- 默认环境 --> <activation> <!-- 默认环境 -->
<activeByDefault>true</activeByDefault> <activeByDefault>true</activeByDefault>
</activation> </activation>
</profile> </profile>
<profile>
<id>dev</id>
<properties> <!-- 环境标识,需要与配置文件的名称相对应 -->
<activatedProperties>dev</activatedProperties>
</properties>
</profile>
<profile> <profile>
<id>test</id> <id>test</id>
<properties> <properties>

View File

@ -16,7 +16,7 @@ mybatis.mapperLocations=classpath:mybatis/mapper/*.xml
#add mybatis #add mybatis
mybatis.config-locations=classpath:mybatis/config.xml mybatis.config-locations=classpath:mybatis/config.xml
#datasource #datasource
spring.datasource.url=jdbc:mysql://localhost:3306/qiurunze?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false spring.datasource.url=jdbc:mysql://localhost:3306/miaosha?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=aixiyue11 spring.datasource.password=aixiyue11
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
@ -67,5 +67,6 @@ spring.rabbitmq.template.retry.initial-interval=1000
spring.rabbitmq.template.retry.max-attempts=3 spring.rabbitmq.template.retry.max-attempts=3
spring.rabbitmq.template.retry.max-interval=10000 spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0 spring.rabbitmq.template.retry.multiplier=1.0
server.port=8003
## maven隔离 ## maven隔离
spring.profiles.active=@activatedProperties@

View File

@ -69,3 +69,5 @@ spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0 spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离 ## maven隔离
spring.profiles.active=@activatedProperties@

View File

@ -69,3 +69,5 @@ spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0 spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离 ## maven隔离
spring.profiles.active=@activatedProperties@

View File

@ -51,6 +51,8 @@ redis.password=123456
redis.poolMaxTotal=1000 redis.poolMaxTotal=1000
redis.poolMaxIdle=500 redis.poolMaxIdle=500
redis.poolMaxWait=500 redis.poolMaxWait=500
#server.port=8003
#rabbitmq #rabbitmq
spring.rabbitmq.host=localhost spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672 spring.rabbitmq.port=5672
@ -69,4 +71,4 @@ spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0 spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离 ## maven隔离
pring.profiles.active=@activatedProperties@ spring.profiles.active=dev

View File

@ -51,6 +51,8 @@ redis.password=123456
redis.poolMaxTotal=1000 redis.poolMaxTotal=1000
redis.poolMaxIdle=500 redis.poolMaxIdle=500
redis.poolMaxWait=500 redis.poolMaxWait=500
#server.port=8003
#rabbitmq #rabbitmq
spring.rabbitmq.host=localhost spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672 spring.rabbitmq.port=5672
@ -69,4 +71,4 @@ spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0 spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离 ## maven隔离
pring.profiles.active=test spring.profiles.active=dev