SpringBoot配置文件application.properties参数详解

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

发表评论

表情:
评论列表 (有 0 条评论,523人围观)

还没有评论,来说两句吧...

相关阅读

    相关 SpringBoot 配置文件详解

      springboot采纳了建立生产就绪spring应用程序的观点。 Spring Boot优先于配置的惯例,旨在让您尽快启动和运行。在一般情况下,我们不需要做太多的配置就能