我刚刚从spring.io https://spring.io/guides/gs/rest-service/
导入了一个java项目我在日食中做到了。我想更改嵌入式tomcat的端口号,但我无法看到任何application.properties(没有src / main / resources),因为我曾经手动创建一个spring boot应用程序文件 - >新建 - > ...
这就是结构的样子
我检查了manifest.yml 甚至打字
服务器: 港口:9090
但它说,未知的财产'服务器'对于类型' Cloudfoundary Manifest'
答案 0 :(得分:5)
在资源文件夹中添加application.properties
#--------------------------------
# Tomcat Port
#----------------------------------
server.port = 8080
# ----------------------------------------
# Logging Level
# ----------------------------------------
logging.level.root=error
logging.level.org.springframework=info
logging.level.org.hibernate=error
# ----------------------------------------
# MySQL DataBase Connection Properties
# ----------------------------------------
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/db
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.show-sql=true
# ----------------------------------------
# ACTUATOR PROPERTIES
# ----------------------------------------
endpoints.actuator.enabled=false
management.security.enabled=false
# ----------------------------------------
# DevTols PROPERTIES
# ----------------------------------------
spring.devtools.restart.enabled=true
# ----------------------------------------
# JSP PREFIX/POSTFIX PROPERTIES
# ----------------------------------------
#spring.thymeleaf.prefix=/view/
#spring.thymeleaf.suffix=.html
答案 1 :(得分:1)