springboot中的Application.properties常用配置
springboot Application.properties常用配置
spring.config.name =#配置文件名(默認(rèn) 為 'application' ) spring.config.location =#配置文件的位置 # 多環(huán)境配置文件激活屬性 spring.profiles.active=dev #加載application-dev.properties配置文件內(nèi)容 application-dev.properties: #開(kāi)發(fā)環(huán)境 application-test.properties: #測(cè)試環(huán)境 application-prod.properties: #生產(chǎn)環(huán)境 #activemq spring.activemq.broker-url #指定ActiveMQ broker的URL,默認(rèn)自動(dòng)生成. spring.activemq.in-memory #是否是內(nèi)存模式,默認(rèn)為true. spring.activemq.password #指定broker的密碼. spring.activemq.pooled #是否創(chuàng)建PooledConnectionFactory,而非ConnectionFactory,默認(rèn)false spring.activemq.user #指定broker的用戶. #aop spring.aop.auto #是否支持@EnableAspectJAutoProxy,默認(rèn)為: true spring.aop.proxy-target-class #true為使用CGLIB代理,false為JDK代理,默認(rèn)為false #application spring.application.admin.enabled #是否啟用admin特性,默認(rèn)為: false spring.application.admin.jmx-name #指定admin MBean的名稱,默認(rèn)為: org.springframework.boot:type=Admin,name=SpringApplication #artemis(HornetQ捐獻(xiàn)給apache后的版本) spring.artemis.embedded.cluster-password #指定集群的密碼,默認(rèn)是啟動(dòng)時(shí)隨機(jī)生成. spring.artemis.embedded.data-directory #指定Journal文件的目錄.如果不開(kāi)始持久化則不必要指定. spring.artemis.embedded.enabled #是否開(kāi)啟內(nèi)嵌模式,默認(rèn)true spring.artemis.embedded.persistent #是否開(kāi)啟persistent store,默認(rèn)false. spring.artemis.embedded.queues #指定啟動(dòng)時(shí)創(chuàng)建的隊(duì)列,多個(gè)用逗號(hào)分隔,默認(rèn): [] spring.artemis.embedded.server-id #指定Server ID. 默認(rèn)是一個(gè)自增的數(shù)字,從0開(kāi)始. spring.artemis.embedded.topics #指定啟動(dòng)時(shí)創(chuàng)建的topic,多個(gè)的話逗號(hào)分隔,默認(rèn): [] spring.artemis.host #指定Artemis broker 的host. 默認(rèn): localhost spring.artemis.mode #指定Artemis 的部署模式, 默認(rèn)為auto-detected(也可以為native or embedded). spring.artemis.port #指定Artemis broker 的端口,默認(rèn)為: 61616 #autoconfig spring.autoconfigure.exclude #配置要排除的Auto-configuration classes. #batch spring.batch.initializer.enabled #是否在必要時(shí)創(chuàng)建batch表,默認(rèn)為true spring.batch.job.enabled #是否在啟動(dòng)時(shí)開(kāi)啟batch job,默認(rèn)為true spring.batch.job.names #指定啟動(dòng)時(shí)要執(zhí)行的job的名稱,逗號(hào)分隔,默認(rèn)所有job都會(huì)被執(zhí)行 spring.batch.schema #指定要初始化的sql語(yǔ)句路徑,默認(rèn):classpath:org/springframework/batch/core/schema-@@platform@@.sql) spring.batch.table-prefix #指定批量處理的表的前綴. #cookie、session配置 server.session.cookie.comment #指定session cookie的comment server.session.cookie.domain #指定session cookie的domain server.session.cookie.http-only #是否開(kāi)啟HttpOnly. server.session.cookie.max-age #設(shè)定session cookie的最大age. server.session.cookie.name #設(shè)定Session cookie 的名稱. server.session.cookie.path #設(shè)定session cookie的路徑. server.session.cookie.secure #設(shè)定session cookie的“Secure” flag. server.session.persistent #重啟時(shí)是否持久化session,默認(rèn)false server.session.timeout #session的超時(shí)時(shí)間 server.session.tracking-modes #設(shè)定Session的追蹤模式(cookie, url, ssl). #datasource spring.dao.exceptiontranslation.enabled #是否開(kāi)啟PersistenceExceptionTranslationPostProcessor,默認(rèn)為true spring.datasource.abandon-when-percentage-full #設(shè)定超時(shí)被廢棄的連接占到多少比例時(shí)要被關(guān)閉或上報(bào) spring.datasource.allow-pool-suspension #使用Hikari pool時(shí),是否允許連接池暫停,默認(rèn)為: false spring.datasource.alternate-username-allowed #是否允許替代的用戶名. spring.datasource.auto-commit #指定updates是否自動(dòng)提交. spring.datasource.catalog #指定默認(rèn)的catalog. spring.datasource.commit-on-return #設(shè)置當(dāng)連接被歸還時(shí),是否要提交所有還未完成的事務(wù) spring.datasource.connection-init-sql #指定連接被創(chuàng)建,再被添加到連接池之前執(zhí)行的sql. spring.datasource.connection-init-sqls #使用DBCP connection pool時(shí),指定初始化時(shí)要執(zhí)行的sql spring.datasource.connection-properties.[key] #在使用DBCP connection pool時(shí)指定要配置的屬性 spring.datasource.connection-test-query #指定校驗(yàn)連接合法性執(zhí)行的sql語(yǔ)句 spring.datasource.connection-timeout #指定連接的超時(shí)時(shí)間,毫秒單位. spring.datasource.continue-on-error #在初始化數(shù)據(jù)庫(kù)時(shí),遇到錯(cuò)誤是否繼續(xù),默認(rèn)false spring.datasource.data #指定Data (DML)腳本 spring.datasource.data-source-class-name #指定數(shù)據(jù)源的全限定名. spring.datasource.data-source-jndi #指定jndi的地址 spring.datasource.data-source-properties.[key] #使用Hikari connection pool時(shí),指定要設(shè)置的屬性 spring.datasource.db-properties #使用Tomcat connection pool,指定要設(shè)置的屬性 spring.datasource.default-auto-commit #是否自動(dòng)提交. spring.datasource.default-catalog #指定連接默認(rèn)的catalog. spring.datasource.default-read-only #是否設(shè)置默認(rèn)連接只讀. spring.datasource.default-transaction-isolation #指定連接的事務(wù)的默認(rèn)隔離級(jí)別. spring.datasource.driver-class-name #指定driver的類名,默認(rèn)從jdbc url中自動(dòng)探測(cè). spring.datasource.fair-queue #是否采用FIFO返回連接. spring.datasource.health-check-properties.[key] #使用Hikari connection pool時(shí),在心跳檢查時(shí)傳遞的屬性 spring.datasource.idle-timeout #指定連接多久沒(méi)被使用時(shí),被設(shè)置為空閑,默認(rèn)為10ms spring.datasource.ignore-exception-on-pre-load #當(dāng)初始化連接池時(shí),是否忽略異常. spring.datasource.init-sql #當(dāng)連接創(chuàng)建時(shí),執(zhí)行的sql spring.datasource.initial-size #指定啟動(dòng)連接池時(shí),初始建立的連接數(shù)量 spring.datasource.initialization-fail-fast #當(dāng)創(chuàng)建連接池時(shí),沒(méi)法創(chuàng)建指定最小連接數(shù)量是否拋異常 spring.datasource.initialize #指定初始化數(shù)據(jù)源,是否用data.sql來(lái)初始化,默認(rèn): true spring.datasource.isolate-internal-queries #指定內(nèi)部查詢是否要被隔離,默認(rèn)為false spring.datasource.jdbc-interceptors #使用Tomcat connection pool時(shí),指定jdbc攔截器,分號(hào)分隔 spring.datasource.jdbc-url #指定JDBC URL. spring.datasource.jmx-enabled #是否開(kāi)啟JMX,默認(rèn)為: false spring.datasource.jndi-name #指定jndi的名稱. spring.datasource.leak-detection-threshold #使用Hikari connection pool時(shí),多少毫秒檢測(cè)一次連接泄露. spring.datasource.log-abandoned #使用DBCP connection pool,是否追蹤廢棄statement或連接,默認(rèn)為: false spring.datasource.log-validation-errors #當(dāng)使用Tomcat connection pool是否打印校驗(yàn)錯(cuò)誤. spring.datasource.login-timeout #指定連接數(shù)據(jù)庫(kù)的超時(shí)時(shí)間. spring.datasource.max-active #指定連接池中最大的活躍連接數(shù). spring.datasource.max-age #指定連接池中連接的最大年齡 spring.datasource.max-idle #指定連接池最大的空閑連接數(shù)量. spring.datasource.max-lifetime #指定連接池中連接的最大生存時(shí)間,毫秒單位. spring.datasource.max-open-prepared-statements #指定最大的打開(kāi)的prepared statements數(shù)量. spring.datasource.max-wait #指定連接池等待連接返回的最大等待時(shí)間,毫秒單位. spring.datasource.maximum-pool-size #指定連接池最大的連接數(shù),包括使用中的和空閑的連接. spring.datasource.min-evictable-idle-time-millis #指定一個(gè)空閑連接最少空閑多久后可被清除. spring.datasource.min-idle #指定必須保持連接的最小值(For DBCP and Tomcat connection pools) spring.datasource.minimum-idle #指定連接維護(hù)的最小空閑連接數(shù),當(dāng)使用HikariCP時(shí)指定. spring.datasource.name #指定數(shù)據(jù)源名. spring.datasource.num-tests-per-eviction-run #指定運(yùn)行每個(gè)idle object evictor線程時(shí)的對(duì)象數(shù)量 spring.datasource.password #指定數(shù)據(jù)庫(kù)密碼. spring.datasource.platform #指定schema要使用的Platform(schema-${platform}.sql),默認(rèn)為: all spring.datasource.pool-name #指定連接池名字. spring.datasource.pool-prepared-statements #指定是否池化statements. spring.datasource.propagate-interrupt-state #在等待連接時(shí),如果線程被中斷,是否傳播中斷狀態(tài). spring.datasource.read-only #當(dāng)使用Hikari connection pool時(shí),是否標(biāo)記數(shù)據(jù)源只讀 spring.datasource.register-mbeans #指定Hikari connection pool是否注冊(cè)JMX MBeans. spring.datasource.remove-abandoned #指定當(dāng)連接超過(guò)廢棄超時(shí)時(shí)間時(shí),是否立刻刪除該連接. spring.datasource.remove-abandoned-timeout #指定連接應(yīng)該被廢棄的時(shí)間. spring.datasource.rollback-on-return #在歸還連接時(shí),是否回滾等待中的事務(wù). spring.datasource.schema #指定Schema (DDL)腳本. spring.datasource.separator #指定初始化腳本的語(yǔ)句分隔符,默認(rèn): ; spring.datasource.sql-script-encoding #指定SQL scripts編碼. spring.datasource.suspect-timeout #指定打印廢棄連接前的超時(shí)時(shí)間. spring.datasource.test-on-borrow #當(dāng)從連接池借用連接時(shí),是否測(cè)試該連接. spring.datasource.test-on-connect #創(chuàng)建時(shí),是否測(cè)試連接 spring.datasource.test-on-return #在連接歸還到連接池時(shí)是否測(cè)試該連接. spring.datasource.test-while-idle #當(dāng)連接空閑時(shí),是否執(zhí)行連接測(cè)試. spring.datasource.time-between-eviction-runs-millis #指定空閑連接檢查、廢棄連接清理、空閑連接池大小調(diào)整之間的操作時(shí)間間隔 spring.datasource.transaction-isolation #指定事務(wù)隔離級(jí)別,使用Hikari connection pool時(shí)指定 spring.datasource.url #指定JDBC URL. spring.datasource.use-disposable-connection-facade #是否對(duì)連接進(jìn)行包裝,防止連接關(guān)閉之后被使用. spring.datasource.use-equals #比較方法名時(shí)是否使用String.equals()替換==. spring.datasource.use-lock #是否對(duì)連接操作加鎖 spring.datasource.username #指定數(shù)據(jù)庫(kù)名. spring.datasource.validation-interval #指定多少ms執(zhí)行一次連接校驗(yàn). spring.datasource.validation-query #指定獲取連接時(shí)連接校驗(yàn)的sql查詢語(yǔ)句. spring.datasource.validation-query-timeout #指定連接校驗(yàn)查詢的超時(shí)時(shí)間. spring.datasource.validation-timeout #設(shè)定連接校驗(yàn)的超時(shí)時(shí)間,當(dāng)使用Hikari connection pool時(shí)指定 spring.datasource.validator-class-name #用來(lái)測(cè)試查詢的validator全限定名. spring.datasource.xa.data-source-class-name #指定數(shù)據(jù)源的全限定名. spring.datasource.xa.properties #指定傳遞給XA data source的屬性 #data springdata spring.data.elasticsearch.cluster-name #指定es集群名稱,默認(rèn): elasticsearch spring.data.elasticsearch.cluster-nodes #指定es的集群,逗號(hào)分隔,不指定的話,則啟動(dòng)client node. spring.data.elasticsearch.properties #指定要配置的es屬性. spring.data.elasticsearch.repositories.enabled #是否開(kāi)啟es存儲(chǔ),默認(rèn)為: true spring.data.jpa.repositories.enabled #是否開(kāi)啟JPA支持,默認(rèn)為: true spring.data.mongodb.authentication-database #指定鑒權(quán)的數(shù)據(jù)庫(kù)名 spring.data.mongodb.database #指定mongodb數(shù)據(jù)庫(kù)名 spring.data.mongodb.field-naming-strategy #指定要使用的FieldNamingStrategy. spring.data.mongodb.grid-fs-database #指定GridFS database的名稱. spring.data.mongodb.host #指定Mongo server host. spring.data.mongodb.password #指定Mongo server的密碼. spring.data.mongodb.port #指定Mongo server port. spring.data.mongodb.repositories.enabled #是否開(kāi)啟mongodb存儲(chǔ),默認(rèn)為true spring.data.mongodb.uri #指定Mongo database URI.默認(rèn):mongodb://localhost/test spring.data.mongodb.username #指定登陸mongodb的用戶名. spring.data.rest.base-path #指定暴露資源的基準(zhǔn)路徑. spring.data.rest.default-page-size #指定每頁(yè)的大小,默認(rèn)為: 20 spring.data.rest.limit-param-name #指定limit的參數(shù)名,默認(rèn)為: size spring.data.rest.max-page-size #指定最大的頁(yè)數(shù),默認(rèn)為1000 spring.data.rest.page-param-name #指定分頁(yè)的參數(shù)名,默認(rèn)為: page spring.data.rest.return-body-on-create #當(dāng)創(chuàng)建完實(shí)體之后,是否返回body,默認(rèn)為false spring.data.rest.return-body-on-update #在更新完實(shí)體后,是否返回body,默認(rèn)為false spring.data.rest.sort-param-name #指定排序使用的key,默認(rèn)為: sort spring.data.solr.host #指定Solr host,如果有指定了zk的host的話,則忽略。默認(rèn)為: http://127.0.0.1:8983/solr spring.data.solr.repositories.enabled #是否開(kāi)啟Solr repositories,默認(rèn)為: true spring.data.solr.zk-host #指定zk的地址,格式為HOST:PORT. #---------------------------------------- #DEVTOOLS屬性 #---------------------------------------- #DEVTOOLS(DevToolsProperties) spring.devtools.livereload.enabled = true #啟用livereload.com兼容的server。 spring.devtools.livereload.port = 35729 #服務(wù)器端口。 spring.devtools.restart.additional-exclude = #應(yīng)該從觸發(fā)完全重新啟動(dòng)時(shí)排除的其他模式。 spring.devtools.restart.additional-paths = #額外的路徑來(lái)觀察變化。 spring.devtools.restart.enabled = true #啟用自動(dòng)重啟。 spring.devtools.restart.exclude = META-INF /行家/ **,META-INF /資源/ **,資源/ **,靜態(tài)/ **,公共/ **,模板/ **,** / * Test.class,** / * Tests.class,git.properties#應(yīng)該排除觸發(fā)完全重啟的模式。 spring.devtools.restart.poll-interval = 1000 #polling 路徑更改之間等待的時(shí)間(以毫秒為單位)。 spring.devtools.restart.quiet-period = 400 #觸發(fā)重新啟動(dòng)之前,沒(méi)有任何類路徑變化所需的靜默時(shí)間(以毫秒為單位)。 spring.devtools.restart.trigger-file = #特定文件的名稱,在更改時(shí)會(huì)觸發(fā)重新啟動(dòng)檢查。如果未指定任何類路徑文件更改將觸發(fā)重新啟動(dòng)。 #DEVTOOLS REMOTE DEVTOOLS(RemoteDevToolsProperties) spring.devtools.remote.context-path = #用于處理遠(yuǎn)程連接的上下文路徑。 spring.devtools.remote.debug.enabled = true #啟用遠(yuǎn)程調(diào)試支持。 spring.devtools.remote.debug.local-port = 8000 #本地遠(yuǎn)程調(diào)試服務(wù)器端口。 spring.devtools.remote.proxy.host = #用于連接遠(yuǎn)程應(yīng)用程序的代理主機(jī)。 spring.devtools.remote.proxy.port = #用于連接遠(yuǎn)程應(yīng)用程序的代理端口。 spring.devtools.remote.restart.enabled = true #啟用遠(yuǎn)程重啟。 spring.devtools.remote.secret = #建立連接所需的共享密鑰(需要啟用遠(yuǎn)程支持)。 spring.devtools.remote.secret-header-name = X-AUTH-TOKEN #用于傳輸共享密鑰的HTTP頭。 #---------------------------------------- #執(zhí)行器屬性 #---------------------------------------- #ENDPOINTS(AbstractEndpoint子類) endpoints.enabled = true #啟用端點(diǎn)。 endpoints.sensitive = #默認(rèn)的端點(diǎn)敏感設(shè)置。 endpoints.actuator.enabled = true #啟用端點(diǎn)。 endpoints.actuator.path = #端點(diǎn)URL路徑。 endpoints.actuator.sensitive = false #在端點(diǎn)上啟用安全性。 endpoints.autoconfig.enabled = #啟用端點(diǎn)。 endpoints.autoconfig.id = #端點(diǎn)標(biāo)識(shí)符。 endpoints.autoconfig.sensitive = #標(biāo)記端點(diǎn)是否暴露敏感信息。 endpoints.beans.enabled = #啟用端點(diǎn)。 endpoints.beans.id = #端點(diǎn)標(biāo)識(shí)符。 endpoints.beans.sensitive = #標(biāo)記端點(diǎn)是否暴露敏感信息。 endpoints.configprops.enabled = #啟用端點(diǎn)。 endpoints.configprops.id = #端點(diǎn)標(biāo)識(shí)符。 endpoints.configprops.keys-to-sanitize #應(yīng)該清理的密鑰。鍵可以是屬性以或正則表達(dá)式結(jié)束的簡(jiǎn)單字符串。 endpoints.configprops.sensitive = #標(biāo)記端點(diǎn)是否公開(kāi)敏感信息。 endpoints.docs.curies.enabled = false #啟用居里代。 endpoints.docs.enabled = true #啟用執(zhí)行器文檔終結(jié)點(diǎn)。 endpoints.docs.path = / docs # endpoints.docs.sensitive = false # #終端CORS配置(EndpointCorsProperties) endpoints.cors.allow-credentials = #設(shè)置是否支持憑據(jù)。未設(shè)置時(shí),不支持憑證。 endpoints.cors.allowed-headers = #在請(qǐng)求中允許使用逗號(hào)分隔的標(biāo)題列表。'*'允許所有標(biāo)題。 endpoints.cors.allowed-methods = GET #逗號(hào)分隔的允許的方法列表。'*'允許所有的方法。 endpoints.cors.allowed-origins = #逗號(hào)分隔的起源列表允許。'*'允許所有的來(lái)源。未設(shè)置時(shí),CORS支持被禁用。 endpoints.cors.exposed-headers = #包含在響應(yīng)中的逗號(hào)分隔的標(biāo)題列表。 endpoints.cors.max-age = 1800 #以秒為單位,客戶端可以緩存飛行前請(qǐng)求的響應(yīng)。 #JMX ENDPOINT(EndpointMBeanExportProperties) endpoints.jmx.domain = #JMX域名。如果設(shè)置,則用“spring.jmx.default-domain”的值初始化。 endpoints.jmx.enabled = true #啟用所有端點(diǎn)的JMX導(dǎo)出。 endpoints.jmx.static-names = #附加到所有表示端點(diǎn)的MBean的ObjectName的靜態(tài)屬性。 endpoints.jmx.unique-names = false #確保ObjectNames在發(fā)生沖突時(shí)被修改。 #flyway flyway.baseline-description #對(duì)執(zhí)行遷移時(shí)基準(zhǔn)版本的描述. flyway.baseline-on-migrate #當(dāng)遷移時(shí)發(fā)現(xiàn)目標(biāo)schema非空,而且?guī)в袥](méi)有元數(shù)據(jù)的表時(shí),是否自動(dòng)執(zhí)行基準(zhǔn)遷移,默認(rèn)false. flyway.baseline-version #開(kāi)始執(zhí)行基準(zhǔn)遷移時(shí)對(duì)現(xiàn)有的schema的版本打標(biāo)簽,默認(rèn)值為1. flyway.check-location #檢查遷移腳本的位置是否存在,默認(rèn)false. flyway.clean-on-validation-error #當(dāng)發(fā)現(xiàn)校驗(yàn)錯(cuò)誤時(shí)是否自動(dòng)調(diào)用clean,默認(rèn)false. flyway.enabled #是否開(kāi)啟flywary,默認(rèn)true. flyway.encoding #設(shè)置遷移時(shí)的編碼,默認(rèn)UTF-8. flyway.ignore-failed-future-migration #當(dāng)讀取元數(shù)據(jù)表時(shí)是否忽略錯(cuò)誤的遷移,默認(rèn)false. flyway.init-sqls #當(dāng)初始化好連接時(shí)要執(zhí)行的SQL. flyway.locations #遷移腳本的位置,默認(rèn)db/migration. flyway.out-of-order #是否允許無(wú)序的遷移,默認(rèn)false. flyway.password #目標(biāo)數(shù)據(jù)庫(kù)的密碼. flyway.placeholder-prefix #設(shè)置每個(gè)placeholder的前綴,默認(rèn)${. flyway.placeholder-replacement #placeholders是否要被替換,默認(rèn)true. flyway.placeholder-suffix #設(shè)置每個(gè)placeholder的后綴,默認(rèn)}. flyway.placeholders.[placeholder name] #設(shè)置placeholder的value flyway.schemas #設(shè)定需要flywary遷移的schema,大小寫(xiě)敏感,默認(rèn)為連接默認(rèn)的schema. flyway.sql-migration-prefix #遷移文件的前綴,默認(rèn)為V. flyway.sql-migration-separator #遷移腳本的文件名分隔符,默認(rèn)__ flyway.sql-migration-suffix #遷移腳本的后綴,默認(rèn)為.sql flyway.table #flyway使用的元數(shù)據(jù)表名,默認(rèn)為schema_version flyway.target #遷移時(shí)使用的目標(biāo)版本,默認(rèn)為latest version flyway.url #遷移時(shí)使用的JDBC URL,如果沒(méi)有指定的話,將使用配置的主數(shù)據(jù)源 flyway.user #遷移數(shù)據(jù)庫(kù)的用戶名 flyway.validate-on-migrate #遷移時(shí)是否校驗(yàn),默認(rèn)為true. #FREEMARKER(FreeMarkerAutoConfiguration) spring.freemarker.allowRequestOverride = false #設(shè)置HttpServletRequest屬性是否允許覆蓋(隱藏)控制器生成的相同名稱的模型屬性。 spring.freemarker.allowSessionOverride = false #設(shè)置HttpSession屬性是否允許覆蓋(隱藏)控制器生成的相同名稱的模型屬性。 spring.freemarker.cache = true #使用模板緩存。 spring.freemarker.charset=UTF-8 # Template encoding. spring.freemarker.checkTemplateLocation = true #檢查模板位置是否存在spring.freemarker.check-template-location=true spring.freemarker.contentType = text / html #Content-Type spring.freemarker.exposeRequestAttributes = false #在與模板合并之前,設(shè)置是否應(yīng)該將所有請(qǐng)求屬性添加到模型中。spring.freemarker.expose-request-attributes=false spring.freemarker.exposeSessionAttributes = false #在與模板合并之前,設(shè)置是否應(yīng)該將所有HttpSession屬性添加到模型中。spring.freemarker.expose-session-attributes=false spring.freemarker.exposeSpringMacroHelpers = false #設(shè)定是否以springMacroRequestContext的形式暴露RequestContext給Spring's macro library使用 spring.freemarker.expose-spring-macro-helpers=true spring.freemarker.prefer-file-system-access=true #是否優(yōu)先從文件系統(tǒng)加載template,以支持熱加載,默認(rèn)為true spring.freemarker.prefix = #在構(gòu)建URL時(shí),前綴被預(yù)先指定以查看名稱。 spring.freemarker.requestContextAttribute = #所有視圖的RequestContext屬性的名稱. freemarker.request-context-attribute= spring.freemarker.settings.* = #Well-known FreeMarker keys which will be passed to FreeMarker's Configuration spring.freemarker.suffix = .ftl #在構(gòu)建URL時(shí)附加到視圖名稱后面的后綴 spring.freemarker.templateEncoding = UTF- 8 spring.freemarker.templateLoaderPath =classpath:/templates #設(shè)定ftl文件路徑 類路徑:/模板/ spring.freemarker.viewNames = ??梢越馕龅囊晥D名稱的白名單 spring.mvc.static-path-pattern=/static/** #設(shè)定靜態(tài)文件路徑,js,css等 #GIT信息 spring.git.properties = #生成的git信息屬性文件的資源引用。 #GROOVY模板(GroovyTemplateAutoConfiguration) spring.groovy.template.allow-request-override #指定HttpServletRequest的屬性是否可以覆蓋controller的model的同名項(xiàng) spring.groovy.template.allow-session-override #指定HttpSession的屬性是否可以覆蓋controller的model的同名項(xiàng) spring.groovy.template.cache #是否開(kāi)啟模板緩存 .spring.groovy.template.charset #指定Template編碼 .spring.groovy.template.check-template-location #是否檢查模板的路徑是否存在. spring.groovy.template.configuration.auto-escape #是否在渲染模板時(shí)自動(dòng)排查model的變量,默認(rèn)為: false spring.groovy.template.configuration.auto-indent #是否在渲染模板時(shí)自動(dòng)縮進(jìn),默認(rèn)為false spring.groovy.template.configuration.auto-indent-string #如果自動(dòng)縮進(jìn)啟用的話,是使用SPACES還是TAB,默認(rèn)為: SPACES spring.groovy.template.configuration.auto-new-line #渲染模板時(shí)是否要輸出換行,默認(rèn)為false spring.groovy.template.configuration.base-template-class #指定template base class. spring.groovy.template.configuration.cache-templates #是否要緩存模板,默認(rèn)為true spring.groovy.template.configuration.declaration-encoding #在寫(xiě)入declaration header時(shí)使用的編碼 spring.groovy.template.configuration.expand-empty-elements #是使用<br/>這種形式,還是<br></br>這種展開(kāi)模式,默認(rèn)為: false) spring.groovy.template.configuration.locale #指定template locale. spring.groovy.template.configuration.new-line-string #當(dāng)啟用自動(dòng)換行時(shí),換行的輸出,默認(rèn)為系統(tǒng)的line.separator屬性的值 spring.groovy.template.configuration.resource-loader-path #指定groovy的模板路徑,默認(rèn)為classpath:/templates/ spring.groovy.template.configuration.use-double-quotes #指定屬性要使用雙引號(hào)還是單引號(hào),默認(rèn)為false spring.groovy.template.content-type #指定Content-Type. spring.groovy.template.enabled #是否開(kāi)啟groovy模板的支持. spring.groovy.template.expose-request-attributes #設(shè)定所有request的屬性在merge到模板的時(shí)候,是否要都添加到model中. spring.groovy.template.expose-session-attributes #設(shè)定所有request的屬性在merge到模板的時(shí)候,是否要都添加到model中. spring.groovy.template.expose-spring-macro-helpers #設(shè)定是否以springMacroRequestContext的形式暴露RequestContext給Spring's macro library使用 spring.groovy.template.prefix #指定模板的前綴. spring.groovy.template.request-context-attribute #指定RequestContext屬性的名. spring.groovy.template.resource-loader-path #指定模板的路徑,默認(rèn)為: classpath:/templates/ spring.groovy.template.suffix #指定模板的后綴 spring.groovy.template.view-names #指定要使用模板的視圖名稱. #h2 spring.h2.console.enabled #是否開(kāi)啟控制臺(tái),默認(rèn)為false spring.h2.console.path #指定控制臺(tái)路徑,默認(rèn)為: /h2-console #hornetq (HornetQProperties) spring.hornetq.embedded.cluster-password #指定集群的密碼,默認(rèn)啟動(dòng)時(shí)隨機(jī)生成. spring.hornetq.embedded.data-directory #指定Journal file 的目錄. 如果不開(kāi)啟持久化則不必指定. spring.hornetq.embedded.enabled #是否開(kāi)啟內(nèi)嵌模式,默認(rèn):true spring.hornetq.embedded.persistent #是否開(kāi)啟persistent store,默認(rèn): false spring.hornetq.embedded.queues #指定啟動(dòng)是創(chuàng)建的queue,多個(gè)以逗號(hào)分隔,默認(rèn): [] spring.hornetq.embedded.server-id #指定Server ID. 默認(rèn)使用自增數(shù)字,從0開(kāi)始. spring.hornetq.embedded.topics #指定啟動(dòng)時(shí)創(chuàng)建的topic,多個(gè)以逗號(hào)分隔,默認(rèn): [] spring.hornetq.host #指定HornetQ broker 的host,默認(rèn): localhost spring.hornetq.mode #指定HornetQ 的部署模式,默認(rèn)是auto-detected,也可以指定native 或者 embedded. spring.hornetq.port #指定HornetQ broker 端口,默認(rèn): 5445 #http spring.hateoas.apply-to-primary-object-mapper #設(shè)定是否對(duì)object mapper也支持HATEOAS,默認(rèn)為: true spring.http.converters.preferred-json-mapper #是否優(yōu)先使用JSON mapper來(lái)轉(zhuǎn)換. spring.http.encoding.charset #指定http請(qǐng)求和相應(yīng)的Charset,默認(rèn): UTF-8 spring.http.encoding.enabled #是否開(kāi)啟http的編碼支持,默認(rèn)為true spring.http.encoding.force #是否強(qiáng)制對(duì)http請(qǐng)求和響應(yīng)進(jìn)行編碼,默認(rèn)為true #jersey spring.jersey.filter.order #指定Jersey filter的order,默認(rèn)為: 0 spring.jersey.init #指定傳遞給Jersey的初始化參數(shù). spring.jersey.type #指定Jersey的集成類型,可以是servlet或者filter. #jms spring.jms.jndi-name #指定Connection factory JNDI 名稱. spring.jms.listener.acknowledge-mode #指定ack模式,默認(rèn)自動(dòng)ack. spring.jms.listener.auto-startup #是否啟動(dòng)時(shí)自動(dòng)啟動(dòng)jms,默認(rèn)為: true spring.jms.listener.concurrency #指定最小的并發(fā)消費(fèi)者數(shù)量. spring.jms.listener.max-concurrency #指定最大的并發(fā)消費(fèi)者數(shù)量. spring.jms.pub-sub-domain #是否使用默認(rèn)的destination type來(lái)支持 publish/subscribe,默認(rèn): false jmx spring.jmx.default-domain #指定JMX domain name. spring.jmx.enabled #是否暴露jmx,默認(rèn)為true spring.jmx.server #指定MBeanServer bean name. 默認(rèn)為: mbeanServer) #jooq spring.jooq.sql-dialect #指定JOOQ使用的SQLDialect,比如POSTGRES. #Messages spring.messages.basename #指定message的basename,多個(gè)以逗號(hào)分隔,如果不加包名的話,默認(rèn)從classpath路徑開(kāi)始,默認(rèn): messages spring.messages.cache-seconds #設(shè)定加載的資源文件緩存失效時(shí)間,-1的話為永不過(guò)期,默認(rèn)為-1 spring.messages.encoding #設(shè)定Message bundles的編碼,默認(rèn): UTF-8 #JPA spring.jpa.database #指定目標(biāo)數(shù)據(jù)庫(kù). spring.jpa.database-platform #指定目標(biāo)數(shù)據(jù)庫(kù)的類型. spring.jpa.generate-ddl #是否在啟動(dòng)時(shí)初始化schema,默認(rèn)為false spring.jpa.hibernate.ddl-auto #指定DDL mode (none, validate, update, create, create-drop). 當(dāng)使用內(nèi)嵌數(shù)據(jù)庫(kù)時(shí),默認(rèn)是create-drop,否則為none. spring.jpa.hibernate.naming-strategy #指定命名策略. spring.jpa.open-in-view #是否注冊(cè)O(shè)penEntityManagerInViewInterceptor,綁定JPA EntityManager到請(qǐng)求線程中,默認(rèn)為: true spring.jpa.properties #添加額外的屬性到JPA provider. spring.jpa.show-sql #是否開(kāi)啟sql的log,默認(rèn)為: false #json spring.jackson.date-format #指定日期格式,比如yyyy-MM-dd HH:mm:ss,或者具體的格式化類的全限定名 spring.jackson.deserialization #是否開(kāi)啟Jackson的反序列化 spring.jackson.generator #是否開(kāi)啟json的generators. spring.jackson.joda-date-time-format #指定Joda date/time的格式,比如yyyy-MM-dd HH:mm:ss). 如果沒(méi)有配置的話,dateformat會(huì)作為backup spring.jackson.locale #指定json使用的Locale. spring.jackson.mapper #是否開(kāi)啟Jackson通用的特性. spring.jackson.parser #是否開(kāi)啟jackson的parser特性. spring.jackson.property-naming-strategy #指定PropertyNamingStrategy (CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES)或者指定PropertyNamingStrategy子類的全限定類名. spring.jackson.serialization #是否開(kāi)啟jackson的序列化. spring.jackson.serialization-inclusion #指定序列化時(shí)屬性的inclusion方式,具體查看JsonInclude.Include枚舉. spring.jackson.time-zone #指定日期格式化時(shí)區(qū),比如America/Los_Angeles或者GMT+10. #JTA spring.jta.allow-multiple-lrc #是否允許 multiple LRC,默認(rèn)為: false spring.jta.asynchronous2-pc #指定兩階段提交是否可以異步,默認(rèn)為: false spring.jta.background-recovery-interval #指定多少分鐘跑一次recovery process,默認(rèn)為: 1 spring.jta.background-recovery-interval-seconds #指定多久跑一次recovery process,默認(rèn): 60 spring.jta.current-node-only-recovery #是否過(guò)濾掉其他非本JVM的recovery,默認(rèn)為: true spring.jta.debug-zero-resource-transaction #是否追蹤沒(méi)有使用指定資源的事務(wù),默認(rèn)為: false spring.jta.default-transaction-timeout #設(shè)定默認(rèn)的事務(wù)超時(shí)時(shí)間,默認(rèn)為60 spring.jta.disable-jmx #是否禁用jmx,默認(rèn)為false spring.jta.enabled #是否開(kāi)啟JTA support,默認(rèn)為: true spring.jta.exception-analyzer #設(shè)置指定的異常分析類 spring.jta.filter-log-status #使用Bitronix Transaction Manager時(shí),是否寫(xiě)mandatory logs,開(kāi)啟的話,可以節(jié)省磁盤(pán)空間,但是調(diào)試會(huì)復(fù)雜寫(xiě),默認(rèn)為false spring.jta.force-batching-enabled #使用Bitronix Transaction Manager時(shí),是否批量寫(xiě)磁盤(pán),默認(rèn)為true. spring.jta.forced-write-enabled #使用Bitronix Transaction Manager時(shí),是否強(qiáng)制寫(xiě)日志到磁盤(pán),默認(rèn)為true spring.jta.graceful-shutdown-interval #當(dāng)使用Bitronix Transaction Manager,指定shutdown時(shí)等待事務(wù)結(jié)束的時(shí)間,超過(guò)則中斷,默認(rèn)為60 spring.jta.jndi-transaction-synchronization-registry-name #當(dāng)使用Bitronix Transaction Manager時(shí),在JNDI下得事務(wù)同步registry,默認(rèn)為: java:comp/TransactionSynchronizationRegistry spring.jta.jndi-user-transaction-name #指定在JNDI使用Bitronix Transaction Manager的名稱,默認(rèn):java:comp/UserTransaction spring.jta.journal #當(dāng)使用Bitronix Transaction Manager,指定The journal是否disk還是null還是一個(gè)類的全限定名,默認(rèn)disk spring.jta.log-dir #Transaction logs directory. spring.jta.log-part1-filename #指定The journal fragment文件1的名字,默認(rèn): btm1.tlog spring.jta.log-part2-filename #指定The journal fragment文件2的名字,默認(rèn): btm2.tlog spring.jta.max-log-size-in-mb #指定journal fragments大小的最大值. 默認(rèn): 2M spring.jta.resource-configuration-filename #指定Bitronix Transaction Manager配置文件名. spring.jta.server-id #指定Bitronix Transaction Manager實(shí)例的id. spring.jta.skip-corrupted-logs #是否忽略corrupted log files文件,默認(rèn)為false. spring.jta.transaction-manager-id #指定Transaction manager的唯一標(biāo)識(shí). spring.jta.warn-about-zero-resource-transaction #當(dāng)使用Bitronix Transaction Manager時(shí),是否對(duì)沒(méi)有使用指定資源的事務(wù)進(jìn)行警告,默認(rèn)為: true #mail spring.mail.default-encoding #指定默認(rèn)MimeMessage的編碼,默認(rèn)為: UTF-8 spring.mail.host #指定SMTP server host. spring.mail.jndi-name #指定mail的jndi名稱 spring.mail.password #指定SMTP server登陸密碼. spring.mail.port #指定SMTP server port. spring.mail.properties #指定JavaMail session屬性. spring.mail.protocol #指定SMTP server使用的協(xié)議,默認(rèn)為: smtp spring.mail.test-connection #指定是否在啟動(dòng)時(shí)測(cè)試郵件服務(wù)器連接,默認(rèn)為false spring.mail.username #指定SMTP server的用戶名. #mobile spring.mobile.devicedelegatingviewresolver.enable-fallback #是否支持fallback的解決方案,默認(rèn)false spring.mobile.devicedelegatingviewresolver.enabled #是否開(kāi)始device view resolver,默認(rèn)為: false spring.mobile.devicedelegatingviewresolver.mobile-prefix #設(shè)定mobile端視圖的前綴,默認(rèn)為:mobile/ spring.mobile.devicedelegatingviewresolver.mobile-suffix #設(shè)定mobile視圖的后綴 spring.mobile.devicedelegatingviewresolver.normal-prefix #設(shè)定普通設(shè)備的視圖前綴 spring.mobile.devicedelegatingviewresolver.normal-suffix #設(shè)定普通設(shè)備視圖的后綴 spring.mobile.devicedelegatingviewresolver.tablet-prefix #設(shè)定平板設(shè)備視圖前綴,默認(rèn):tablet/ spring.mobile.devicedelegatingviewresolver.tablet-suffix #設(shè)定平板設(shè)備視圖后綴. spring.mobile.sitepreference.enabled #是否啟用SitePreferenceHandler,默認(rèn)為: true #MONGODB(Mongo性能) spring.data.mongodb.host = #分貝主機(jī) spring.data.mongodb.port = 27017 #連接端口(默認(rèn)為 27107 ) spring.data.mongodb.uri = #連接URL spring.mongodb.embedded.features #指定要開(kāi)啟的特性,逗號(hào)分隔. spring.mongodb.embedded.version #指定要使用的版本,默認(rèn): 2.6.10 #MANAGEMENT HTTP SERVER(ManagementServerProperties) management.add-application-context-header = true#在每個(gè)響應(yīng)中添加“X-Application-Context”HTTP標(biāo)頭。 management.address = #管理端點(diǎn)應(yīng)該綁定的網(wǎng)絡(luò)地址。 management.context-path = #管理端點(diǎn)上下文路徑。例如`/執(zhí)行器` management.port = #管理端點(diǎn)HTTP端口。默認(rèn)使用與應(yīng)用程序相同的端口。 management.security.enabled = true #啟用 management.security.role = ADMIN #訪問(wèn)管理端點(diǎn)所需的角色。 management.security.sessions #會(huì)話創(chuàng)建策略使用(always, never, if_required, stateless)。 #HEALTH INDICATORS健康指標(biāo)(以前的健康狀況*) management.health.db.enabled = true #啟用數(shù)據(jù)庫(kù)運(yùn)行狀況檢查。 management.health.defaults.enabled = true #啟用默認(rèn)健康指標(biāo)。 management.health.diskspace.enabled = true #啟用磁盤(pán)空間運(yùn)行狀況檢查。 management.health.diskspace.path = #用于計(jì)算可用磁盤(pán)空間的路徑。 management.health.diskspace.threshold = 0 #應(yīng)該可用的最小磁盤(pán)空間(以字節(jié)為單位)。 management.health.elasticsearch.enabled = true #啟用elasticsearch運(yùn)行狀況檢查。 management.health.elasticsearch.indices = #逗號(hào)分隔的索引名稱。 management.health.elasticsearch.response-timeout = 100 #等待群集響應(yīng)的時(shí)間(以毫秒為單位)。 management.health.jms.enabled = true #啟用JMS運(yùn)行狀況檢查。 management.health.mail.enabled = true #啟用郵件運(yùn)行狀況檢查。 management.health.mongo.enabled = true #啟用MongoDB運(yùn)行狀況檢查。 management.health.rabbit.enabled = true #啟用RabbitMQ健康檢查。 management.health.redis.enabled = true #啟用Redis運(yùn)行狀況檢查。 management.health.solr.enabled = true #啟用Solr運(yùn)行狀況檢查。 management.health.status.order #以逗號(hào)分隔的健康狀態(tài)列表。 management.trace.include #要包含在跟蹤中的項(xiàng)目。 #METRICS EXPORT(MetricExportProperties) spring.metrics.export.aggregate.key-pattern = #告訴聚合器如何處理源存儲(chǔ)庫(kù)中的密鑰的模式。 spring.metrics.export.aggregate.prefix = #全局存儲(chǔ)庫(kù)的前綴(如果處于活動(dòng)狀態(tài))。 spring.metrics.export.delay-millis = 5000 #輸出滴答之間的延遲(以毫秒為單位)。度量標(biāo)準(zhǔn)按照計(jì)劃導(dǎo)出到外部源。 spring.metrics.export.enabled = true #啟用metric 標(biāo)準(zhǔn)導(dǎo)出的標(biāo)志(假設(shè)MetricWriter可用)。 spring.metrics.export.excludes = #要排除的metric 標(biāo)準(zhǔn)名稱的模式列表。包括后應(yīng)用。 spring.metrics.export.includes = #要包含的metric 標(biāo)準(zhǔn)名稱的模式列表。 spring.metrics.export.redis.key #Redis存儲(chǔ)庫(kù)導(dǎo)出密鑰(如果有效)。 spring.metrics.export.redis.prefix #如果處于活動(dòng)狀態(tài),redis存儲(chǔ)庫(kù)的前綴。 spring.metrics.export.send-latest #根據(jù)不導(dǎo)出不變的metric 值的標(biāo)志關(guān)閉所有可用的優(yōu)化。 spring.metrics.export.statsd.host = #接收導(dǎo)出metric 的statsd server的主機(jī)。 spring.metrics.export.statsd.port = 8125 #接收導(dǎo)出metric的statsd server的端口。 spring.metrics.export.statsd.prefix = #統(tǒng)計(jì)導(dǎo)出metric的前綴。 spring.metrics.export.triggers。* = #每個(gè)MetricWriter bean名稱的特定觸發(fā)器屬性。 #multipart multipart.enabled #是否開(kāi)啟文件上傳支持,默認(rèn)為true multipart.file-size-threshold #設(shè)定文件寫(xiě)入磁盤(pán)的閾值,單位為MB或KB,默認(rèn)為0 multipart.location #指定文件上傳路徑. multipart.max-file-size #指定文件大小最大值,默認(rèn)1MB multipart.max-request-size #指定每次請(qǐng)求的最大值,默認(rèn)為10MB #mustcache spring.mustache.cache #是否Enable template caching. spring.mustache.charset #指定Template的編碼. spring.mustache.check-template-location #是否檢查默認(rèn)的路徑是否存在. spring.mustache.content-type #指定Content-Type. spring.mustache.enabled #是否開(kāi)啟mustcache的模板支持. spring.mustache.prefix #指定模板的前綴,默認(rèn): classpath:/templates/ spring.mustache.suffix #指定模板的后綴,默認(rèn): .html spring.mustache.view-names #指定要使用模板的視圖名. #MVC(SPRING MVC相關(guān)的一些配置) http.mappers.json-pretty-print = false #打印JSON http.mappers.json-sort-keys = false #排序鍵 spring.mvc.locale = #設(shè)置固定語(yǔ)言環(huán)境,例如en_UK spring.mvc.date-format = #設(shè)置固定的日期格式,例如dd / MM / yyyy spring.mvc.async.request-timeout #設(shè)定async請(qǐng)求的超時(shí)時(shí)間,以毫秒為單位,如果沒(méi)有設(shè)置的話,以具體實(shí)現(xiàn)的超時(shí)時(shí)間為準(zhǔn),比如tomcat的servlet3的話是10秒. spring.mvc.favicon.enabled #是否支持favicon.ico,默認(rèn)為: true spring.mvc.ignore-default-model-on-redirect #在重定向時(shí)是否忽略默認(rèn)model的內(nèi)容,默認(rèn)為true spring.mvc.locale#指定使用的Locale. spring.mvc.message-codes-resolver-format #指定message codes的格式化策略(PREFIX_ERROR_CODE,POSTFIX_ERROR_CODE). spring.view.prefix = #MVC視圖前綴 spring.view.suffix = #...和后綴 spring.resources.cache-period = #發(fā)送到瀏覽器的標(biāo)題緩存超時(shí) spring.resources.add-mappings = true #如果 應(yīng)該添加默認(rèn)映射 #liquibase liquibase.change-log #Change log 配置文件的路徑,默認(rèn)值為classpath:/db/changelog/db.changelog-master.yaml liquibase.check-change-log-location #是否堅(jiān)持change log的位置是否存在,默認(rèn)為true. liquibase.contexts #逗號(hào)分隔的運(yùn)行時(shí)context列表. liquibase.default-schema #默認(rèn)的schema. liquibase.drop-first #是否首先drop schema,默認(rèn)為false liquibase.enabled #是否開(kāi)啟liquibase,默認(rèn)為true. liquibase.password #目標(biāo)數(shù)據(jù)庫(kù)密碼 liquibase.url #要遷移的JDBC URL,如果沒(méi)有指定的話,將使用配置的主數(shù)據(jù)源. liquibase.user #目標(biāo)數(shù)據(jù)用戶名 #logging日志 logging.path = #文件路徑 logging.file = myapp.log #文件名稱 logging.config = #如果你即想完全掌控日志配置,但又不想用logback.xml作為L(zhǎng)ogback配置的名字,可以通過(guò)logging.config屬性指定自定義的名字 logging.level.root=INFO #日志級(jí)別 從控制臺(tái)打印出來(lái)的日志級(jí)別只有ERROR, WARN 還有INFO,如果你想要打印debug級(jí)別的日志,可以配置debug=true logging.level.org.springframework.web=DEBUG logging.level.org.hibernate=ERROR #rabbitmq spring.rabbitmq.addresses #指定client連接到的server的地址,多個(gè)以逗號(hào)分隔. spring.rabbitmq.dynamic #是否創(chuàng)建AmqpAdmin bean. 默認(rèn)為: true) spring.rabbitmq.host #指定RabbitMQ host.默認(rèn)為: localhost) spring.rabbitmq.listener.acknowledge-mode #指定Acknowledge的模式. spring.rabbitmq.listener.auto-startup #是否在啟動(dòng)時(shí)就啟動(dòng)mq,默認(rèn): true) spring.rabbitmq.listener.concurrency #指定最小的消費(fèi)者數(shù)量. spring.rabbitmq.listener.max-concurrency #指定最大的消費(fèi)者數(shù)量. spring.rabbitmq.listener.prefetch #指定一個(gè)請(qǐng)求能處理多少個(gè)消息,如果有事務(wù)的話,必須大于等于transaction數(shù)量. spring.rabbitmq.listener.transaction-size #指定一個(gè)事務(wù)處理的消息數(shù)量,最好是小于等于prefetch的數(shù)量. spring.rabbitmq.password #指定broker的密碼. spring.rabbitmq.port #指定RabbitMQ 的端口,默認(rèn): 5672) spring.rabbitmq.requested-heartbeat #指定心跳超時(shí),0為不指定. spring.rabbitmq.ssl.enabled #是否開(kāi)始SSL,默認(rèn): false) spring.rabbitmq.ssl.key-store #指定持有SSL certificate的key store的路徑 spring.rabbitmq.ssl.key-store-password #指定訪問(wèn)key store的密碼. spring.rabbitmq.ssl.trust-store #指定持有SSL certificates的Trust store. spring.rabbitmq.ssl.trust-store-password #指定訪問(wèn)trust store的密碼. spring.rabbitmq.username #指定登陸broker的用戶名. spring.rabbitmq.virtual-host #指定連接到broker的Virtual host. #redis spring.redis.database #指定連接工廠使用的Database index,默認(rèn)為: 0 spring.redis.host #指定Redis server host,默認(rèn)為: localhost spring.redis.password #指定Redis server的密碼 spring.redis.pool.max-active #指定連接池最大的活躍連接數(shù),-1表示無(wú)限,默認(rèn)為8 spring.redis.pool.max-idle #指定連接池最大的空閑連接數(shù),-1表示無(wú)限,默認(rèn)為8 spring.redis.pool.max-wait #指定當(dāng)連接池耗盡時(shí),新獲取連接需要等待的最大時(shí)間,以毫秒單位,-1表示無(wú)限等待 spring.redis.pool.min-idle #指定連接池中空閑連接的最小數(shù)量,默認(rèn)為0 spring.redis.port #指定redis服務(wù)端端口,默認(rèn): 6379 spring.redis.sentinel.master #指定redis server的名稱 spring.redis.sentinel.nodes #指定sentinel節(jié)點(diǎn),逗號(hào)分隔,格式為host:port. spring.redis.timeout #指定連接超時(shí)時(shí)間,毫秒單位,默認(rèn)為0 #resource spring.resources.add-mappings #是否開(kāi)啟默認(rèn)的資源處理,默認(rèn)為true spring.resources.cache-period #設(shè)定資源的緩存時(shí)效,以秒為單位. spring.resources.chain.cache #是否開(kāi)啟緩存,默認(rèn)為: true spring.resources.chain.enabled #是否開(kāi)啟資源 handling chain,默認(rèn)為false spring.resources.chain.html-application-cache #是否開(kāi)啟h5應(yīng)用的cache manifest重寫(xiě),默認(rèn)為: false spring.resources.chain.strategy.content.enabled #是否開(kāi)啟內(nèi)容版本策略,默認(rèn)為false spring.resources.chain.strategy.content.paths #指定要應(yīng)用的版本的路徑,多個(gè)以逗號(hào)分隔,默認(rèn)為:[/**] spring.resources.chain.strategy.fixed.enabled #是否開(kāi)啟固定的版本策略,默認(rèn)為false spring.resources.chain.strategy.fixed.paths #指定要應(yīng)用版本策略的路徑,多個(gè)以逗號(hào)分隔 spring.resources.chain.strategy.fixed.version #指定版本策略使用的版本號(hào) spring.resources.static-locations #指定靜態(tài)資源路徑,默認(rèn)為classpath:[/META-INF/resources/,/resources/, /static/, /public/]以及context:/ #security spring security是springboot支持的權(quán)限控制系統(tǒng)。 security.basic.authorize-mode #要使用權(quán)限控制模式. security.basic.enabled #是否開(kāi)啟基本的鑒權(quán),默認(rèn)為true security.basic.path #需要鑒權(quán)的path,多個(gè)的話以逗號(hào)分隔,默認(rèn)為[/**] security.basic.realm #HTTP basic realm 的名字,默認(rèn)為Spring security.enable-csrf #是否開(kāi)啟cross-site request forgery校驗(yàn),默認(rèn)為false. security.filter-order #Security filter chain的order,默認(rèn)為0 security.headers.cache #是否開(kāi)啟http頭部的cache控制,默認(rèn)為false. security.headers.content-type #是否開(kāi)啟X-Content-Type-Options頭部,默認(rèn)為false. security.headers.frame #是否開(kāi)啟X-Frame-Options頭部,默認(rèn)為false. security.headers.hsts #指定HTTP Strict Transport Security (HSTS)模式(none, domain, all). security.headers.xss #是否開(kāi)啟cross-site scripting (XSS) 保護(hù),默認(rèn)為false. security.ignored #指定不鑒權(quán)的路徑,多個(gè)的話以逗號(hào)分隔. security.oauth2.client.access-token-uri #指定獲取access token的URI. security.oauth2.client.access-token-validity-seconds #指定access token失效時(shí)長(zhǎng). security.oauth2.client.additional-information.[key] #設(shè)定要添加的額外信息. security.oauth2.client.authentication-scheme #指定傳輸不記名令牌(bearer token)的方式(form, header, none,query),默認(rèn)為header security.oauth2.client.authorities #指定授予客戶端的權(quán)限. security.oauth2.client.authorized-grant-types #指定客戶端允許的grant types. security.oauth2.client.auto-approve-scopes #對(duì)客戶端自動(dòng)授權(quán)的scope. security.oauth2.client.client-authentication-scheme #傳輸authentication credentials的方式(form, header, none, query),默認(rèn)為header方式 security.oauth2.client.client-id #指定OAuth2 client ID. security.oauth2.client.client-secret #指定OAuth2 client secret. 默認(rèn)是一個(gè)隨機(jī)的secret. security.oauth2.client.grant-type #指定獲取資源的access token的授權(quán)類型. security.oauth2.client.id #指定應(yīng)用的client ID. security.oauth2.client.pre-established-redirect-uri #服務(wù)端pre-established的跳轉(zhuǎn)URI. security.oauth2.client.refresh-token-validity-seconds #指定refresh token的有效期. security.oauth2.client.registered-redirect-uri #指定客戶端跳轉(zhuǎn)URI,多個(gè)以逗號(hào)分隔. security.oauth2.client.resource-ids #指定客戶端相關(guān)的資源id,多個(gè)以逗號(hào)分隔. security.oauth2.client.scope #client的scope security.oauth2.client.token-name #指定token的名稱 security.oauth2.client.use-current-uri #是否優(yōu)先使用請(qǐng)求中URI,再使用pre-established的跳轉(zhuǎn)URI. 默認(rèn)為true security.oauth2.client.user-authorization-uri #用戶跳轉(zhuǎn)去獲取access token的URI. security.oauth2.resource.id #指定resource的唯一標(biāo)識(shí). security.oauth2.resource.jwt.key-uri #JWT token的URI. 當(dāng)key為公鑰時(shí),或者value不指定時(shí)指定. security.oauth2.resource.jwt.key-value #JWT token驗(yàn)證的value. 可以是對(duì)稱加密或者PEMencoded RSA公鑰. 可以使用URI作為value. security.oauth2.resource.prefer-token-info #是否使用token info,默認(rèn)為true security.oauth2.resource.service-id #指定service ID,默認(rèn)為resource. security.oauth2.resource.token-info-uri #token解碼的URI. security.oauth2.resource.token-type #指定當(dāng)使用userInfoUri時(shí),發(fā)送的token類型. security.oauth2.resource.user-info-uri #指定user info的URI security.oauth2.sso.filter-order #如果沒(méi)有顯示提供WebSecurityConfigurerAdapter時(shí)指定的Filter order. security.oauth2.sso.login-path #跳轉(zhuǎn)到SSO的登錄路徑默認(rèn)為/login. security.require-ssl #是否對(duì)所有請(qǐng)求開(kāi)啟SSL,默認(rèn)為false. security.sessions #指定Session的創(chuàng)建策略(always, never, if_required, stateless). security.user.name #指定默認(rèn)的用戶名,默認(rèn)為user. security.user.password #默認(rèn)的用戶密碼. security.user.role #默認(rèn)用戶的授權(quán)角色. #sendgrid spring.sendgrid.password #指定SendGrid password. spring.sendgrid.proxy.host #指定SendGrid proxy host. spring.sendgrid.proxy.port #指定SendGrid proxy port. spring.sendgrid.username #指定SendGrid username. #server配置 server.address #指定server綁定的地址 server.compression.enabled #是否開(kāi)啟壓縮,默認(rèn)為false. server.compression.excluded-user-agents #指定不壓縮的user-agent,多個(gè)以逗號(hào)分隔,默認(rèn)值為:text/html,text/xml,text/plain,text/css server.compression.mime-types #指定要壓縮的MIME type,多個(gè)以逗號(hào)分隔. server.compression.min-response-size #執(zhí)行壓縮的閾值,默認(rèn)為2048 server.context-parameters.[param name] #設(shè)置servlet context 參數(shù) server.context-path #設(shè)定應(yīng)用的context-path. server.display-name #設(shè)定應(yīng)用的展示名稱,默認(rèn): application server.jsp-servlet.class-name #設(shè)定編譯JSP用的servlet,默認(rèn): org.apache.jasper.servlet.JspServlet) server.jsp-servlet.init-parameters.[param name] #設(shè)置JSP servlet 初始化參數(shù). server.jsp-servlet.registered #設(shè)定JSP servlet是否注冊(cè)到內(nèi)嵌的servlet容器,默認(rèn)true server.port #設(shè)定http監(jiān)聽(tīng)端口 server.servlet-path #設(shè)定dispatcher servlet的監(jiān)聽(tīng)路徑,默認(rèn)為: / #SHELL REMOTE SHELL shell.auth = simple #認(rèn)證類型。根據(jù)環(huán)境自動(dòng)檢測(cè)。 shell.auth.jaas.domain =my-domain #JAAS域。 shell.auth.key.path = #認(rèn)證密鑰的路徑。這應(yīng)該指向一個(gè)有效的“.pem”文件。 shell.auth.simple.user.name = user #登錄用戶。 shell.auth.simple.user.password = #登錄密碼。 shell.auth.spring.roles = ADMIN #用于登錄到CRaSH控制臺(tái)的所需角色的逗號(hào)分隔列表。 shell.command-path-patterns = classpath *:/ commands / **,classpath *:/ crash / commands / **#用于查找命令的模式。 shell.command-refresh-interval = -1 #掃描更改并在必要時(shí)更新命令(以秒為單位)。 shell.config-path-patterns = #用于查找配置的模式。 shell.disabled-commands #禁用命令的逗號(hào)分隔列表。 shell.disabled-plugins = #禁用逗號(hào)分隔的插件列表。根據(jù)環(huán)境,某些插件默認(rèn)是禁用的。 shell.ssh.auth-timeout = #用戶提示重新登錄后的毫秒數(shù)。 shell.ssh.enabled = true #啟用CRaSH SSH支持。 shell.ssh.idle-timeout = #關(guān)閉未使用的連接之后的毫秒數(shù)。 shell.ssh.key-path = #SSH服務(wù)器密鑰的路徑。 shell.ssh.port = 2000 #SSH端口。 shell.telnet.enabled = false #啟用CRaSH telnet支持。如果TelnetPlugin可用,則默認(rèn)啟用。 shell.telnet.port = 5000 #Telnet端口。 #social spring.social.auto-connection-views #是否開(kāi)啟連接狀態(tài)的視圖,默認(rèn)為false spring.social.facebook.app-id #指定應(yīng)用id spring.social.facebook.app-secret #指定應(yīng)用密碼 spring.social.linkedin.app-id #指定應(yīng)用id spring.social.linkedin.app-secret #指定應(yīng)用密碼 spring.social.twitter.app-id #指定應(yīng)用ID. spring.social.twitter.app-secret #指定應(yīng)用密碼 #ssl配置 server.ssl.ciphers #是否支持SSL ciphers. server.ssl.client-auth #設(shè)定client authentication是wanted 還是 needed. server.ssl.enabled #是否開(kāi)啟ssl,默認(rèn): true server.ssl.key-alias #設(shè)定key store中key的別名. server.ssl.key-password #訪問(wèn)key store中key的密碼. server.ssl.key-store #設(shè)定持有SSL certificate的key store的路徑,通常是一個(gè).jks文件. server.ssl.key-store-password #設(shè)定訪問(wèn)key store的密碼. server.ssl.key-store-provider #設(shè)定key store的提供者. server.ssl.key-store-type #設(shè)定key store的類型. server.ssl.protocol #使用的SSL協(xié)議,默認(rèn): TLS server.ssl.trust-store #持有SSL certificates的Trust store. server.ssl.trust-store-password #訪問(wèn)trust store的密碼. server.ssl.trust-store-provider #設(shè)定trust store的提供者. server.ssl.trust-store-type #指定trust store的類型. #tomcat服務(wù)器配置(ServerProperties) server.port = 8080 #端口 server.address = #該服務(wù)綁定IP地址,啟動(dòng)服務(wù)器時(shí)如本機(jī)不是該IP地址則拋出異常啟動(dòng)失敗,只有特殊需求的情況下才配置 server.session-timeout = #會(huì)話超時(shí)秒數(shù) 默認(rèn)30 server.context-path = #上下文路徑,默認(rèn)為 '/' server.servlet-path = #servlet路徑,默認(rèn)為 '/' server.tomcat.access-log-pattern = #訪問(wèn)日志的日志模式 server.tomcat.access-log-enabled = false #啟用訪問(wèn)日志記錄 server.tomcat.protocol-header = x -forwarded-proto #ssl轉(zhuǎn)發(fā)標(biāo)頭 server.tomcat.accesslog.pattern #設(shè)定access logs的格式,默認(rèn): common server.tomcat.accesslog.prefix #設(shè)定Log 文件的前綴,默認(rèn): access_log server.tomcat.accesslog.suffix #設(shè)定Log 文件的后綴,默認(rèn): .log server.tomcat.background-processor-delay = 30 ; # 后臺(tái)線程方法的Delay大小: 30 server.tomcat.basedir #設(shè)定Tomcat的base 目錄,如果沒(méi)有指定則使用臨時(shí)目錄. server.tomcat.internal-proxies #設(shè)定信任的正則表達(dá)式,默認(rèn):“10\.\d{1,3}\.\d{1,3}\.\d{1,3}| 192\.168\.\d{1,3}\.\d{1,3}| #169\.254\.\d{1,3}\.\d{1,3}| 127\.\d{1,3}\.\d{1,3}\.\d{1,3}| 172\.1[6-9]{1}\.\d{1,3}\ #.\d{1,3}| 172\.2[0-9]{1}\.\d{1,3}\.\d{1,3}|172\.3[0-1]{1}\.\d{1,3}\.\d{1,3}” server.tomcat.max-http-header-size #設(shè)定http header的最小值,默認(rèn): 0 server.tomcat.max-threads #設(shè)定tomcat的最大工作線程數(shù),默認(rèn)為: 0 server.tomcat.port-header #設(shè)定http header使用的,用來(lái)覆蓋原來(lái)port的value. server.tomcat.protocol-header #設(shè)定Header包含的協(xié)議,通常是 X-Forwarded-Proto,如果remoteIpHeader有值,則將設(shè)置為RemoteIpValve. server.tomcat.protocol-header-https-value #設(shè)定使用SSL的header的值,默認(rèn)https. server.tomcat.remote-ip-header #設(shè)定remote IP的header,如果remoteIpHeader有值,則設(shè)置為RemoteIpValve server.tomcat.uri-encoding #設(shè)定URI的解碼字符集. #THYMELEAF(Thymeleaf 模板) spring.thymeleaf.prefix = #類路徑:/模板/ 檢查模板位置 spring.thymeleaf.suffix = spring.thymeleaf.mode = HTML5 #模板的模式 spring.thymeleaf.encoding = UTF- 8 spring.thymeleaf.content-type = text / html#; charset = <編碼> spring.thymeleaf.cache = true #這個(gè)開(kāi)發(fā)配置為false,避免改了模板還要重啟服務(wù)器 #undertow server.undertow.access-log-dir #設(shè)定Undertow access log 的目錄,默認(rèn): logs server.undertow.access-log-enabled #是否開(kāi)啟access log,默認(rèn): false server.undertow.access-log-pattern #設(shè)定access logs的格式,默認(rèn): common server.undertow.accesslog.dir #設(shè)定access log 的目錄. server.undertow.buffer-size #設(shè)定buffer的大小. server.undertow.buffers-per-region #設(shè)定每個(gè)region的buffer數(shù) server.undertow.direct-buffers #設(shè)定堆外內(nèi)存 server.undertow.io-threads #設(shè)定I/O線程數(shù). server.undertow.worker-threads #設(shè)定工作線程數(shù) #velocity spring.velocity.allow-request-override #指定HttpServletRequest的屬性是否可以覆蓋controller的model的同名項(xiàng) spring.velocity.allow-session-override #指定HttpSession的屬性是否可以覆蓋controller的model的同名項(xiàng) spring.velocity.cache #是否開(kāi)啟模板緩存 spring.velocity.charset #設(shè)定模板編碼 spring.velocity.check-template-location #是否檢查模板路徑是否存在. spring.velocity.content-type #設(shè)定ContentType的值 spring.velocity.date-tool-attribute #設(shè)定暴露給velocity上下文使用的DateTool的名 spring.velocity.enabled #設(shè)定是否允許mvc使用velocity spring.velocity.expose-request-attributes #是否在merge模板的時(shí)候,將request屬性都添加到model中 spring.velocity.expose-session-attributes #是否在merge模板的時(shí)候,將HttpSession屬性都添加到model中 spring.velocity.expose-spring-macro-helpers #設(shè)定是否以springMacroRequestContext的名來(lái)暴露RequestContext給Spring's macro類庫(kù)使用 spring.velocity.number-tool-attribute #設(shè)定暴露給velocity上下文的NumberTool的名 spring.velocity.prefer-file-system-access #是否優(yōu)先從文件系統(tǒng)加載模板以支持熱加載,默認(rèn)為true spring.velocity.prefix #設(shè)定velocity模板的前綴. spring.velocity.properties #設(shè)置velocity的額外屬性. spring.velocity.request-context-attribute #設(shè)定RequestContext attribute的名. spring.velocity.resource-loader-path #設(shè)定模板路徑,默認(rèn)為: classpath:/templates/ spring.velocity.suffix #設(shè)定velocity模板的后綴. spring.velocity.toolbox-config-location #設(shè)定Velocity Toolbox配置文件的路徑,比如 /WEB-INF/toolbox.xml. spring.velocity.view-names
springboot application.properties編寫(xiě)值需要注意的事項(xiàng)
初次使用Boot-Thymeleaf配置文件的坑
使用Thymeleaf的時(shí)候,需要加入以下信息到配置文件中
PS使用Thymeleaf需要在POM中加入以下代碼
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
Thymeleaf在配置文件中的屬性配置
spring.thymeleaf.cache=true spring.thymeleaf.content-type=text/html spring.thymeleaf.encoding=UTF-8 spring.thymeleaf.enabled=true spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.suffix=.html spring.thymeleaf.mode=HTML5
如果在配置文件KEY=VALUE中VALUE值后面保留著空格,那么該配置項(xiàng)也是不同的
列如我在spring.thymeleaf.encoding=UTF-8 最后編寫(xiě)成spring.thymeleaf.encoding=UTF-8空格那么我在啟動(dòng)類的時(shí)候就會(huì)報(bào)以下的錯(cuò)誤
***************************
APPLICATION FAILED TO START
***************************Description:
Binding to target org.springframework.boot.autoconfigure.thymeleaf.ThymeleafProperties@1a1d3c1a failed:
Property: spring.thymeleaf.encoding
Value: UTF-8
Reason: Failed to convert property value of type 'java.lang.String' to required type 'java.nio.charset.Charset' for property 'encoding'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.nio.charset.Charset]
Action:Update your application's configuration
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
Jmeter多臺(tái)機(jī)器并發(fā)請(qǐng)求實(shí)現(xiàn)壓力性能測(cè)試
這篇文章主要介紹了Jmeter多臺(tái)機(jī)器并發(fā)請(qǐng)求實(shí)現(xiàn)壓力性能測(cè)試,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-10-10使用springboot aop來(lái)實(shí)現(xiàn)讀寫(xiě)分離和事物配置
這篇文章主要介紹了使用springboot aop來(lái)實(shí)現(xiàn)讀寫(xiě)分離和事物配置,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-04-04Java lambda list轉(zhuǎn)換map時(shí),把多個(gè)參數(shù)拼接作為key操作
這篇文章主要介紹了Java lambda list轉(zhuǎn)換map時(shí),把多個(gè)參數(shù)拼接作為key操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-08-08SpringCloud之熔斷器Hystrix的實(shí)現(xiàn)
這篇文章主要介紹了SpringCloud之熔斷器Hystrix的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-08-08Spring中常見(jiàn)的7種BeanDefinition詳解
在?Spring?容器中,我們廣泛使用的是一個(gè)一個(gè)的?Bean,BeanDefinition?從名字上就可以看出是關(guān)于?Bean?的定義,下面就跟隨小編一起深入了解一下常見(jiàn)的7中BeanDefinition吧2023-09-09MyBatis XML方式的基本用法之多表查詢功能的示例代碼
這篇文章主要介紹了MyBatis XML方式的基本用法之多表查詢功能的示例代碼,本文通過(guò)示例文字相結(jié)合的形式給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-07-07解決Mybatis映射文件mapper.xml中的注釋問(wèn)題
這篇文章主要介紹了解決Mybatis映射文件mapper.xml中的注釋問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教。2022-01-01