Java【Spring boot 常用配置】

Spring boot 常用配置
1.程序基本配置
Spring boot 默认端口是 8080 ,如果想要进行更改的话,只需要修改 applicatoin.properties 文件,在配置文件中
加入:
server.port=9090
常用配置:
########################################################
###EMBEDDED SERVER CONFIGURATION (ServerProperties)
########################################################
#server.port=8080
#server.address= # bind to a specific NIC
#server.session-timeout= # session timeout in seconds
#the context path, defaults to '/'
#server.context-path=/spring-boot # 修改默认访问路径
#server.servlet-path= # the servlet path, defaults to '/'
#server.tomcat.access-log-pattern= # log pattern of the access log
#server.tomcat.access-log-enabled=false # is access logging enabled
#server.tomcat.protocol-header=x-forwarded-proto # ssl forward headers
#server.tomcat.remote-ip-header=x-forwarded-for
#server.tomcat.basedir=/tmp # base dir (usually not needed, defaults to tmp)
#server.tomcat.background-processor-delay=30; # in seconds
#server.tomcat.max-threads = 0 # number of threads in protocol handler
#server.tomcat.uri-encoding = UTF-8 # character encoding to use for URL decoding
2.修改 java 编译版本
Spring Boot 在编译的时候,是有默认 JDK 版本的,如果我们期望使用我们要的 JDK 版本的话,那么要怎么配置
呢?
这个只需要修改 pom.xml 文件的<build> -- <plugins>加入一个 plugin 即可。
< plugin >
< artifactId > maven-compiler-plugin </ artifactId >
< configuration >
< source > 1.8 </ source >
< target > 1.8 </ target >
</ configuration >
</ plugin >
添加了 plugin 之后,需要右键 Maven à Update Projects,这时候你可以看到工程根目录下的 JRE System Library
版本更改了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

God Zhang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值