Thirumal
Thirumal

Reputation: 9536

How to override spring boot properties?

How to override spring boot properties at runtime?

Below command works fine in terminal

    mvn spring-boot:run -Dspring-boot.run.arguments=--server.port=8081

but it's not working in Eclipse

    -Dspring-boot.run.arguments=--server.port=8081

Runtime Argument

Upvotes: 1

Views: 2496

Answers (2)

rchakraborty
rchakraborty

Reputation: 51

Use -Dserver.port=8081 as vm argument from run configuration of eclipse. It will work

Upvotes: 0

Sambit
Sambit

Reputation: 8001

You have two options.

  1. You can configure server.port=8081 in application.properties file in spring boot application.
  2. Configure only -Dserver.port=8081 in VM arguments in eclipse as displayed in the image.

Upvotes: 2

Related Questions