提交 d94fe1b6 编写于 作者: Q qiurunze123

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

上级 87c7ac9c
<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>
\ No newline at end of file
此差异已折叠。
......@@ -127,3 +127,12 @@ redis的数量不是库存,他的作用仅仅只是为了阻挡多余的请求
本文使用的是注解方法开发所以不做过多解释<br>
下面仔细讲解以下如何详细使用xml开发在目录里面有一个与本文无挂的类似于微信自动回复的功能br>
里面有mybatis的全部解析和用法,大家可以简单的当做一个demo来使用<br>
### maven 隔离
maven隔离就是在开发中,把各个环境的隔离开来,一般分为
本地(local)
开发(dev)
测试(test)
线上(prod)
在环境部署中为了防止人工修改的弊端! spring.profiles.active=@activatedProperties@
\ No newline at end of file
......@@ -169,7 +169,7 @@
<directory>src/main/resources</directory> <!--这里对应项目存放配置文件的目录--> <!--开启filtering功能 -->
<filtering>true</filtering>
<excludes>
<exclude>application.properties</exclude>
<exclude>application-local.properties</exclude>
<exclude>application-dev.properties</exclude>
<exclude>application-prod.properties</exclude>
<exclude>application-test.properties</exclude>
......@@ -194,14 +194,20 @@
<profiles>
<profile>
<id>dev</id>
<id>local</id>
<properties> <!-- 环境标识,需要与配置文件的名称相对应 -->
<activatedProperties>dev</activatedProperties>
<activatedProperties>local</activatedProperties>
</properties>
<activation> <!-- 默认环境 -->
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>dev</id>
<properties> <!-- 环境标识,需要与配置文件的名称相对应 -->
<activatedProperties>dev</activatedProperties>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
......
......@@ -16,7 +16,7 @@ mybatis.mapperLocations=classpath:mybatis/mapper/*.xml
#add mybatis
mybatis.config-locations=classpath:mybatis/config.xml
#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.password=aixiyue11
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-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离
\ No newline at end of file
server.port=8003
## maven隔离
spring.profiles.active=@activatedProperties@
\ No newline at end of file
......@@ -68,4 +68,6 @@ spring.rabbitmq.template.retry.max-attempts=3
spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离
\ No newline at end of file
## maven隔离
spring.profiles.active=@activatedProperties@
\ No newline at end of file
......@@ -68,4 +68,6 @@ spring.rabbitmq.template.retry.max-attempts=3
spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离
\ No newline at end of file
## maven隔离
spring.profiles.active=@activatedProperties@
\ No newline at end of file
......@@ -51,6 +51,8 @@ redis.password=123456
redis.poolMaxTotal=1000
redis.poolMaxIdle=500
redis.poolMaxWait=500
#server.port=8003
#rabbitmq
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
......@@ -69,4 +71,4 @@ spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离
pring.profiles.active=@activatedProperties@
\ No newline at end of file
spring.profiles.active=dev
\ No newline at end of file
......@@ -51,6 +51,8 @@ redis.password=123456
redis.poolMaxTotal=1000
redis.poolMaxIdle=500
redis.poolMaxWait=500
#server.port=8003
#rabbitmq
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
......@@ -69,4 +71,4 @@ spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离
pring.profiles.active=test
\ No newline at end of file
spring.profiles.active=dev
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册