1. 程式人生 > >spring boot application properties配置詳解

spring boot application properties配置詳解

ini let encoding odi gap pool nodes gui erp

  1. # ===================================================================
  2. # COMMON SPRING BOOT PROPERTIES
  3. #
  4. # This sample file is provided as a guideline. Do NOT copy it in its
  5. # entirety to your own application. ^^^
  6. # ===================================================================
  7. # ----------------------------------------
  8. # CORE PROPERTIES
  9. # ----------------------------------------
  10. # SPRING CONFIG (ConfigFileApplicationListener)
  11. spring.config.name= # config file name (default to ‘application‘)
  12. spring.config.location= # location of config file
  13. # PROFILES
  14. spring.profiles= # comma list of active profiles
  15. # APPLICATION SETTINGS (SpringApplication)
  16. spring.main.sources=
  17. spring.main.web-environment= # detect by default
  18. spring.main.show-banner=true
  19. spring.main....= # see class for all properties
  20. # LOGGING
  21. logging.path=/var/logs
  22. logging.file=myapp.log
  23. logging.config=
  24. # IDENTITY (ContextIdApplicationContextInitializer)
  25. spring.application.name=
  26. spring.application.index=
  27. # EMBEDDED SERVER CONFIGURATION (ServerProperties)
  28. server.port=8080
  29. server.address= # bind to a specific NIC
  30. server.session-timeout= # session timeout in seconds
  31. server.context-path= # the context path, defaults to ‘/‘
  32. server.servlet-path= # the servlet path, defaults to ‘/‘
  33. server.tomcat.access-log-pattern= # log pattern of the access log
  34. server.tomcat.access-log-enabled=false # is access logging enabled
  35. server.tomcat.protocol-header=x-forwarded-proto # ssl forward headers
  36. server.tomcat.remote-ip-header=x-forwarded-for
  37. server.tomcat.basedir=/tmp # base dir (usually not needed, defaults to tmp)
  38. server.tomcat.background-processor-delay=30; # in seconds
  39. server.tomcat.max-threads = 0 # number of threads in protocol handler
  40. server.tomcat.uri-encoding = UTF-8 # character encoding to use for URL decoding
  41. # SPRING MVC (HttpMapperProperties)
  42. http.mappers.json-pretty-print=false # pretty print JSON
  43. http.mappers.json-sort-keys=false # sort keys
  44. spring.mvc.locale= # set fixed locale, e.g. en_UK
  45. spring.mvc.date-format= # set fixed date format, e.g. dd/MM/yyyy
  46. spring.mvc.message-codes-resolver-format= # PREFIX_ERROR_CODE / POSTFIX_ERROR_CODE
  47. spring.view.prefix= # MVC view prefix
  48. spring.view.suffix= # ... and suffix
  49. spring.resources.cache-period= # cache timeouts in headers sent to browser
  50. spring.resources.add-mappings=true # if default mappings should be added
  51. # THYMELEAF (ThymeleafAutoConfiguration)
  52. spring.thymeleaf.prefix=classpath:/templates/
  53. spring.thymeleaf.suffix=.html
  54. spring.thymeleaf.mode=HTML5
  55. spring.thymeleaf.encoding=UTF-8
  56. spring.thymeleaf.content-type=text/html # ;charset=<encoding> is added
  57. spring.thymeleaf.cache=true # set to false for hot refresh
  58. # FREEMARKER (FreeMarkerAutoConfiguration)
  59. spring.freemarker.allowRequestOverride=false
  60. spring.freemarker.allowSessionOverride=false
  61. spring.freemarker.cache=true
  62. spring.freemarker.checkTemplateLocation=true
  63. spring.freemarker.contentType=text/html
  64. spring.freemarker.exposeRequestAttributes=false
  65. spring.freemarker.exposeSessionAttributes=false
  66. spring.freemarker.exposeSpringMacroHelpers=false
  67. spring.freemarker.prefix=
  68. spring.freemarker.requestContextAttribute=
  69. spring.freemarker.settings.*=
  70. spring.freemarker.suffix=.ftl
  71. spring.freemarker.templateEncoding=UTF-8
  72. spring.freemarker.templateLoaderPath=classpath:/templates/
  73. spring.freemarker.viewNames= # whitelist of view names that can be resolved
  74. # GROOVY TEMPLATES (GroovyTemplateAutoConfiguration)
  75. spring.groovy.template.allowRequestOverride=false
  76. spring.groovy.template.allowSessionOverride=false
  77. spring.groovy.template.cache=true
  78. spring.groovy.template.configuration.*= # See Groovy‘s TemplateConfiguration
  79. spring.groovy.template.contentType=text/html
  80. spring.groovy.template.prefix=classpath:/templates/
  81. spring.groovy.template.suffix=.tpl
  82. spring.groovy.template.templateEncoding=UTF-8
  83. spring.groovy.template.viewNames= # whitelist of view names that can be resolved
  84. # VELOCITY TEMPLATES (VelocityAutoConfiguration)
  85. spring.velocity.allowRequestOverride=false
  86. spring.velocity.allowSessionOverride=false
  87. spring.velocity.cache=true
  88. spring.velocity.checkTemplateLocation=true
  89. spring.velocity.contentType=text/html
  90. spring.velocity.dateToolAttribute=
  91. spring.velocity.exposeRequestAttributes=false
  92. spring.velocity.exposeSessionAttributes=false
  93. spring.velocity.exposeSpringMacroHelpers=false
  94. spring.velocity.numberToolAttribute=
  95. spring.velocity.prefix=
  96. spring.velocity.properties.*=
  97. spring.velocity.requestContextAttribute=
  98. spring.velocity.resourceLoaderPath=classpath:/templates/
  99. spring.velocity.suffix=.vm
  100. spring.velocity.templateEncoding=UTF-8
  101. spring.velocity.viewNames= # whitelist of view names that can be resolved
  102. # INTERNATIONALIZATION (MessageSourceAutoConfiguration)
  103. spring.messages.basename=messages
  104. spring.messages.cacheSeconds=-1
  105. spring.messages.encoding=UTF-8
  106. # SECURITY (SecurityProperties)
  107. security.user.name=user # login username
  108. security.user.password= # login password
  109. security.user.role=USER # role assigned to the user
  110. security.require-ssl=false # advanced settings ...
  111. security.enable-csrf=false
  112. security.basic.enabled=true
  113. security.basic.realm=Spring
  114. security.basic.path= # /**
  115. security.headers.xss=false
  116. security.headers.cache=false
  117. security.headers.frame=false
  118. security.headers.contentType=false
  119. security.headers.hsts=all # none / domain / all
  120. security.sessions=stateless # always / never / if_required / stateless
  121. security.ignored=false
  122. # DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
  123. spring.datasource.name= # name of the data source
  124. spring.datasource.initialize=true # populate using data.sql
  125. spring.datasource.schema= # a schema (DDL) script resource reference
  126. spring.datasource.data= # a data (DML) script resource reference
  127. spring.datasource.platform= # the platform to use in the schema resource (schema-${platform}.sql)
  128. spring.datasource.continueOnError=false # continue even if can‘t be initialized
  129. spring.datasource.separator=; # statement separator in SQL initialization scripts
  130. spring.datasource.driverClassName= # JDBC Settings...
  131. spring.datasource.url=
  132. spring.datasource.username=
  133. spring.datasource.password=
  134. spring.datasource.max-active=100 # Advanced configuration...
  135. spring.datasource.max-idle=8
  136. spring.datasource.min-idle=8
  137. spring.datasource.initial-size=10
  138. spring.datasource.validation-query=
  139. spring.datasource.test-on-borrow=false
  140. spring.datasource.test-on-return=false
  141. spring.datasource.test-while-idle=
  142. spring.datasource.time-between-eviction-runs-millis=
  143. spring.datasource.min-evictable-idle-time-millis=
  144. spring.datasource.max-wait-millis=
  145. # MONGODB (MongoProperties)
  146. spring.data.mongodb.host= # the db host
  147. spring.data.mongodb.port=27017 # the connection port (defaults to 27107)
  148. spring.data.mongodb.uri=mongodb://localhost/test # connection URL
  149. spring.data.mongo.repositories.enabled=true # if spring data repository support is enabled
  150. # JPA (JpaBaseConfiguration, HibernateJpaAutoConfiguration)
  151. spring.jpa.properties.*= # properties to set on the JPA connection
  152. spring.jpa.openInView=true
  153. spring.jpa.show-sql=true
  154. spring.jpa.database-platform=
  155. spring.jpa.database=
  156. spring.jpa.generate-ddl=false # ignored by Hibernate, might be useful for other vendors
  157. spring.jpa.hibernate.naming-strategy= # naming classname
  158. spring.jpa.hibernate.ddl-auto= # defaults to create-drop for embedded dbs
  159. spring.data.jpa.repositories.enabled=true # if spring data repository support is enabled
  160. # SOLR (SolrProperties})
  161. spring.data.solr.host=http://127.0.0.1:8983/solr
  162. spring.data.solr.zkHost=
  163. spring.data.solr.repositories.enabled=true # if spring data repository support is enabled
  164. # ELASTICSEARCH (ElasticsearchProperties})
  165. spring.data.elasticsearch.cluster-name= # The cluster name (defaults to elasticsearch)
  166. spring.data.elasticsearch.cluster-nodes= # The address(es) of the server node (comma-separated; if not specified starts a client node)
  167. spring.data.elasticsearch.local=true # if local mode should be used with client nodes
  168. spring.data.elasticsearch.repositories.enabled=true # if spring data repository support is enabled
  169. # FLYWAY (FlywayProperties)
  170. flyway.locations=classpath:db/migrations # locations of migrations scripts
  171. flyway.schemas= # schemas to update
  172. flyway.initVersion= 1 # version to start migration
  173. flyway.prefix=V
  174. flyway.suffix=.sql
  175. flyway.enabled=true
  176. flyway.url= # JDBC url if you want Flyway to create its own DataSource
  177. flyway.user= # JDBC username if you want Flyway to create its own DataSource
  178. flyway.password= # JDBC password if you want Flyway to create its own DataSource
  179. # LIQUIBASE (LiquibaseProperties)
  180. liquibase.change-log=classpath:/db/changelog/db.changelog-master.yaml
  181. liquibase.contexts= # runtime contexts to use
  182. liquibase.default-schema= # default database schema to use
  183. liquibase.drop-first=false
  184. liquibase.enabled=true
  185. # JMX
  186. spring.jmx.enabled=true # Expose MBeans from Spring
  187. # RABBIT (RabbitProperties)
  188. spring.rabbitmq.host= # connection host
  189. spring.rabbitmq.port= # connection port
  190. spring.rabbitmq.addresses= # connection addresses (e.g. myhost:9999,otherhost:1111)
  191. spring.rabbitmq.username= # login user
  192. spring.rabbitmq.password= # login password
  193. spring.rabbitmq.virtualhost=
  194. spring.rabbitmq.dynamic=
  195. # REDIS (RedisProperties)
  196. spring.redis.host=localhost # server host
  197. spring.redis.password= # server password
  198. spring.redis.port=6379 # connection port
  199. spring.redis.pool.max-idle=8 # pool settings ...
  200. spring.redis.pool.min-idle=0
  201. spring.redis.pool.max-active=8
  202. spring.redis.pool.max-wait=-1
  203. # ACTIVEMQ (ActiveMQProperties)
  204. spring.activemq.broker-url=tcp://localhost:61616 # connection URL
  205. spring.activemq.user=
  206. spring.activemq.password=
  207. spring.activemq.in-memory=true # broker kind to create if no broker-url is specified
  208. spring.activemq.pooled=false
  209. # HornetQ (HornetQProperties)
  210. spring.hornetq.mode= # connection mode (native, embedded)
  211. spring.hornetq.host=localhost # hornetQ host (native mode)
  212. spring.hornetq.port=5445 # hornetQ port (native mode)
  213. spring.hornetq.embedded.enabled=true # if the embedded server is enabled (needs hornetq-jms-server.jar)
  214. spring.hornetq.embedded.serverId= # auto-generated id of the embedded server (integer)
  215. spring.hornetq.embedded.persistent=false # message persistence
  216. spring.hornetq.embedded.data-directory= # location of data content (when persistence is enabled)
  217. spring.hornetq.embedded.queues= # comma separate queues to create on startup
  218. spring.hornetq.embedded.topics= # comma separate topics to create on startup
  219. spring.hornetq.embedded.cluster-password= # customer password (randomly generated by default)
  220. # JMS (JmsProperties)
  221. spring.jms.pub-sub-domain= # false for queue (default), true for topic
  222. # SPRING BATCH (BatchDatabaseInitializer)
  223. spring.batch.job.names=job1,job2
  224. spring.batch.job.enabled=true
  225. spring.batch.initializer.enabled=true
  226. spring.batch.schema= # batch schema to load
  227. # AOP
  228. spring.aop.auto=
  229. spring.aop.proxy-target-class=
  230. # FILE ENCODING (FileEncodingApplicationListener)
  231. spring.mandatory-file-encoding=false
  232. # SPRING SOCIAL (SocialWebAutoConfiguration)
  233. spring.social.auto-connection-views=true # Set to true for default connection views or false if you provide your own
  234. # SPRING SOCIAL FACEBOOK (FacebookAutoConfiguration)
  235. spring.social.facebook.app-id= # your application‘s Facebook App ID
  236. spring.social.facebook.app-secret= # your application‘s Facebook App Secret
  237. # SPRING SOCIAL LINKEDIN (LinkedInAutoConfiguration)
  238. spring.social.linkedin.app-id= # your application‘s LinkedIn App ID
  239. spring.social.linkedin.app-secret= # your application‘s LinkedIn App Secret
  240. # SPRING SOCIAL TWITTER (TwitterAutoConfiguration)
  241. spring.social.twitter.app-id= # your application‘s Twitter App ID
  242. spring.social.twitter.app-secret= # your application‘s Twitter App Secret
  243. # SPRING MOBILE SITE PREFERENCE (SitePreferenceAutoConfiguration)
  244. spring.mobile.sitepreference.enabled=true # enabled by default
  245. # SPRING MOBILE DEVICE VIEWS (DeviceDelegatingViewResolverAutoConfiguration)
  246. spring.mobile.devicedelegatingviewresolver.enabled=true # disabled by default
  247. spring.mobile.devicedelegatingviewresolver.normalPrefix=
  248. spring.mobile.devicedelegatingviewresolver.normalSuffix=
  249. spring.mobile.devicedelegatingviewresolver.mobilePrefix=mobile/
  250. spring.mobile.devicedelegatingviewresolver.mobileSuffix=
  251. spring.mobile.devicedelegatingviewresolver.tabletPrefix=tablet/
  252. spring.mobile.devicedelegatingviewresolver.tabletSuffix=
  253. # ----------------------------------------
  254. # ACTUATOR PROPERTIES
  255. # ----------------------------------------
  256. # MANAGEMENT HTTP SERVER (ManagementServerProperties)
  257. management.port= # defaults to ‘server.port‘
  258. management.address= # bind to a specific NIC
  259. management.contextPath= # default to ‘/‘
  260. # ENDPOINTS (AbstractEndpoint subclasses)
  261. endpoints.autoconfig.id=autoconfig
  262. endpoints.autoconfig.sensitive=true
  263. endpoints.autoconfig.enabled=true
  264. endpoints.beans.id=beans
  265. endpoints.beans.sensitive=true
  266. endpoints.beans.enabled=true
  267. endpoints.configprops.id=configprops
  268. endpoints.configprops.sensitive=true
  269. endpoints.configprops.enabled=true
  270. endpoints.configprops.keys-to-sanitize=password,secret
  271. endpoints.dump.id=dump
  272. endpoints.dump.sensitive=true
  273. endpoints.dump.enabled=true
  274. endpoints.env.id=env
  275. endpoints.env.sensitive=true
  276. endpoints.env.enabled=true
  277. endpoints.health.id=health
  278. endpoints.health.sensitive=false
  279. endpoints.health.enabled=true
  280. endpoints.info.id=info
  281. endpoints.info.sensitive=false
  282. endpoints.info.enabled=true
  283. endpoints.metrics.id=metrics
  284. endpoints.metrics.sensitive=true
  285. endpoints.metrics.enabled=true
  286. endpoints.shutdown.id=shutdown
  287. endpoints.shutdown.sensitive=true
  288. endpoints.shutdown.enabled=false
  289. endpoints.trace.id=trace
  290. endpoints.trace.sensitive=true
  291. endpoints.trace.enabled=true
  292. # MVC ONLY ENDPOINTS
  293. endpoints.jolokia.path=jolokia
  294. endpoints.jolokia.sensitive=true
  295. endpoints.jolokia.enabled=true # when using Jolokia
  296. endpoints.error.path=/error
  297. # JMX ENDPOINT (EndpointMBeanExportProperties)
  298. endpoints.jmx.enabled=true
  299. endpoints.jmx.domain= # the JMX domain, defaults to ‘org.springboot‘
  300. endpoints.jmx.unique-names=false
  301. endpoints.jmx.enabled=true
  302. endpoints.jmx.staticNames=
  303. # JOLOKIA (JolokiaProperties)
  304. jolokia.config.*= # See Jolokia manual
  305. # REMOTE SHELL
  306. shell.auth=simple # jaas, key, simple, spring
  307. shell.command-refresh-interval=-1
  308. shell.command-path-pattern= # classpath*:/commands/**, classpath*:/crash/commands/**
  309. shell.config-path-patterns= # classpath*:/crash/*
  310. shell.disabled-plugins=false # don‘t expose plugins
  311. shell.ssh.enabled= # ssh settings ...
  312. shell.ssh.keyPath=
  313. shell.ssh.port=
  314. shell.telnet.enabled= # telnet settings ...
  315. shell.telnet.port=
  316. shell.auth.jaas.domain= # authentication settings ...
  317. shell.auth.key.path=
  318. shell.auth.simple.user.name=
  319. shell.auth.simple.user.password=
  320. shell.auth.spring.roles=
  321. # GIT INFO
  322. spring.git.properties= # resource ref to generated git info properties file

spring boot application properties配置詳解