4

I just imported a java project from spring.io https://spring.io/guides/gs/rest-service/

I did it in my eclipse. I want to change the port number for the embedded tomcat to run but I can't see any application.properties (there is no src/main/resources) as it used to be when I would manually create a spring boot application through File->New->...

This is how the structure looks like

enter image description here

I checked out manifest.yml and even typed

server: port : 9090

but it says, unknown property 'server' for type 'Cloudfoundary Manifest'

Shad
  • 1,185
  • 1
  • 12
  • 27

2 Answers2

6

add application.properties in your resource folder

#--------------------------------
# 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
Satya Prakash
  • 676
  • 7
  • 15
1

YOu can add application.properties

You source folder will look like this ignore other files

enter image description here

gladiator
  • 1,249
  • 8
  • 23
  • It works now! I had made the folder name as 'resource' changed it to 'resources' and it works! One last question. Where is the checking of this pattern is taking place? who is doing that? – Shad Dec 05 '17 at 10:14