소스 검색

增加spring boot application.yml profiles.active 配置

wkeyuan 4 년 전
부모
커밋
456a07b64a
4개의 변경된 파일176개의 추가작업 그리고 57개의 파일을 삭제
  1. 58 0
      src/main/resources/application-dev.yml
  2. 58 0
      src/main/resources/application-prod.yml
  3. 58 0
      src/main/resources/application-test.yml
  4. 2 57
      src/main/resources/application.yml

+ 58 - 0
src/main/resources/application-dev.yml

@@ -0,0 +1,58 @@
+dwsurvey:
+  site: 'local'
+  web:
+    file-path: ~/Documents/target/
+    back-site:
+      mode: auto
+      url: http://localhost:8282/dwsurvey
+    up:
+      file-type:
+        anon: JPEG,PNG,GIF
+        user: JPEG,PNG,GIF,XLS
+    info:
+      site-name: 调问网
+      site-url: http://www.diaowen.net
+      site-icp: 京ICP备13050030号-3
+      site-mail: service@diaowen.net
+      site-phone: 18888888888
+  version:
+    info: DWSurvey OSS V5.0 Spring Boot
+    number: OSS V5.0
+    built: 2021/11/21
+# mysql
+server:
+  port: 8080
+
+spring:
+  web:
+    resources:
+      static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${dwsurvey.web.file-path}
+  mvc:
+    static-path-pattern: /**
+    view:
+      prefix: /WEB-INF/page/content
+      suffix: .jsp
+  datasource:
+    #type: com.alibaba.druid.pool.DruidDataSource
+    url: jdbc:mysql://localhost:3306/dwsurvey_21test?useUnicode=true&characterEncoding=utf8
+    username: root
+    password: 123456,.
+  jpa:
+    database: mysql
+    generate-ddl: true
+    show-sql: true
+    hibernate:
+      ddl-auto: update
+     # naming:
+      #  implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl #指定jpa的自动表生成策略,驼峰自动映射为下划线格式
+    properties:
+      hibernate:
+        #是否自动打印hql对应的sql语句
+        show-sql: false
+        #是否格式化sql语句
+        format-sql: false
+        #事务交由spring管理
+        current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext
+        cache:
+          use_second_level_cache: false
+          use_query_cache: false

+ 58 - 0
src/main/resources/application-prod.yml

@@ -0,0 +1,58 @@
+dwsurvey:
+  site: 'local'
+  web:
+    file-path: ~/Documents/target/
+    back-site:
+      mode: auto
+      url: http://localhost:8282/dwsurvey
+    up:
+      file-type:
+        anon: JPEG,PNG,GIF
+        user: JPEG,PNG,GIF,XLS
+    info:
+      site-name: 调问网
+      site-url: http://www.diaowen.net
+      site-icp: 京ICP备13050030号-3
+      site-mail: service@diaowen.net
+      site-phone: 18888888888
+  version:
+    info: DWSurvey OSS V5.0 Spring Boot
+    number: OSS V5.0
+    built: 2021/11/21
+# mysql
+server:
+  port: 8080
+
+spring:
+  web:
+    resources:
+      static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${dwsurvey.web.file-path}
+  mvc:
+    static-path-pattern: /**
+    view:
+      prefix: /WEB-INF/page/content
+      suffix: .jsp
+  datasource:
+    #type: com.alibaba.druid.pool.DruidDataSource
+    url: jdbc:mysql://localhost:3306/dwsurvey_21test?useUnicode=true&characterEncoding=utf8
+    username: root
+    password: 123456,.
+  jpa:
+    database: mysql
+    generate-ddl: true
+    show-sql: true
+    hibernate:
+      ddl-auto: update
+     # naming:
+      #  implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl #指定jpa的自动表生成策略,驼峰自动映射为下划线格式
+    properties:
+      hibernate:
+        #是否自动打印hql对应的sql语句
+        show-sql: false
+        #是否格式化sql语句
+        format-sql: false
+        #事务交由spring管理
+        current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext
+        cache:
+          use_second_level_cache: false
+          use_query_cache: false

+ 58 - 0
src/main/resources/application-test.yml

@@ -0,0 +1,58 @@
+dwsurvey:
+  site: 'local'
+  web:
+    file-path: ~/Documents/target/
+    back-site:
+      mode: auto
+      url: http://localhost:8282/dwsurvey
+    up:
+      file-type:
+        anon: JPEG,PNG,GIF
+        user: JPEG,PNG,GIF,XLS
+    info:
+      site-name: 调问网
+      site-url: http://www.diaowen.net
+      site-icp: 京ICP备13050030号-3
+      site-mail: service@diaowen.net
+      site-phone: 18888888888
+  version:
+    info: DWSurvey OSS V5.0 Spring Boot
+    number: OSS V5.0
+    built: 2021/11/21
+# mysql
+server:
+  port: 8080
+
+spring:
+  web:
+    resources:
+      static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${dwsurvey.web.file-path}
+  mvc:
+    static-path-pattern: /**
+    view:
+      prefix: /WEB-INF/page/content
+      suffix: .jsp
+  datasource:
+    #type: com.alibaba.druid.pool.DruidDataSource
+    url: jdbc:mysql://localhost:3306/dwsurvey_21test?useUnicode=true&characterEncoding=utf8
+    username: root
+    password: 123456,.
+  jpa:
+    database: mysql
+    generate-ddl: true
+    show-sql: true
+    hibernate:
+      ddl-auto: update
+     # naming:
+      #  implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl #指定jpa的自动表生成策略,驼峰自动映射为下划线格式
+    properties:
+      hibernate:
+        #是否自动打印hql对应的sql语句
+        show-sql: false
+        #是否格式化sql语句
+        format-sql: false
+        #事务交由spring管理
+        current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext
+        cache:
+          use_second_level_cache: false
+          use_query_cache: false

+ 2 - 57
src/main/resources/application.yml

@@ -1,58 +1,3 @@
-dwsurvey:
-  site: 'local'
-  web:
-    file-path: ~/Documents/target/
-    back-site:
-      mode: auto
-      url: http://localhost:8282/dwsurvey
-    up:
-      file-type:
-        anon: JPEG,PNG,GIF
-        user: JPEG,PNG,GIF,XLS
-    info:
-      site-name: 调问网
-      site-url: http://www.diaowen.net
-      site-icp: 京ICP备13050030号-3
-      site-mail: service@diaowen.net
-      site-phone: 18888888888
-  version:
-    info: DWSurvey OSS V5.0 Spring Boot
-    number: OSS V5.0
-    built: 2021/11/21
-# mysql
-server:
-  port: 8080
-
 spring:
-  web:
-    resources:
-      static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${dwsurvey.web.file-path}
-  mvc:
-    static-path-pattern: /**
-    view:
-      prefix: /WEB-INF/page/content
-      suffix: .jsp
-  datasource:
-    #type: com.alibaba.druid.pool.DruidDataSource
-    url: jdbc:mysql://localhost:3306/dwsurvey_21test?useUnicode=true&characterEncoding=utf8
-    username: root
-    password: 123456,.
-  jpa:
-    database: mysql
-    generate-ddl: true
-    show-sql: true
-    hibernate:
-      ddl-auto: update
-     # naming:
-      #  implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl #指定jpa的自动表生成策略,驼峰自动映射为下划线格式
-    properties:
-      hibernate:
-        #是否自动打印hql对应的sql语句
-        show-sql: false
-        #是否格式化sql语句
-        format-sql: false
-        #事务交由spring管理
-        current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext
-        cache:
-          use_second_level_cache: false
-          use_query_cache: false
+  profiles:
+    active: dev