alexanoid
alexanoid

Reputation: 25790

Spring Boot Maven plugin - spring-boot:run and production

Is it a good idea or practice to start a Spring Boot application at production with a following command of Spring Boot Maven plugin ?

mvn spring-boot:run 

Upvotes: 4

Views: 1578

Answers (2)

hennr
hennr

Reputation: 2762

No, this is a bad idea. You would re-build your project on every run which means that you would pull all needed dependencies on each new VM / container.

Also using the spring-boot-maven-plugin in conjunction with the dev-tools for example would lead to options that you don't want in production. This ranges from using other database settings to disabled caching mechanisms for your templating engine.

Use the executable jar instead.

Upvotes: 4

UserF40
UserF40

Reputation: 3611

If you want to run the application with the Maven JVM this is fine.

It is just an alternative way to run your application instead of using the executable jar.

As an alternative you could also start your application with gradle

gradle bootRun

Which is best depends on your circumstance. For live production code I would use a versioned executable jar always.

Upvotes: 0

Related Questions