Questions tagged [spring-boot]

Use the Spring Boot tag for questions related to spring boot framework and the features it brings to your Web application. This includes questions about configuration, embedding of the Web servers, setting up metrics, health checks, externalized configuration etc. It does not include questions about the Web server itself, Java code running in your application, or standard spring components. Tag these questions with its own tags to get the best response!

Spring Boot makes it very easy to create a Spring-powered application with a minimum amount of work. An application created with Spring Boot (you can quickly do it using Spring Initializr) can be:

  • Created without a single line of configuration,
  • Created without any requirement of an application server because Spring Boot provides an application server (Embed , or ).
  • Largely autoconfigured with some sensible defaults and opinionated starter POMs to simplify your configuration,
  • Provide production-ready features such as metrics, health checks, and externalized configuration.

Spring Boot consists of several (optional) modules

Spring Boot CLI

A command line interface, based on , for starting/stopping Spring Boot created applications.

Spring Boot Core

The base for other modules, but it also provides some functionality that can be used on its own, eg. using command line arguments and files as Spring Environment property sources and automatically binding environment properties to Spring bean properties (with validation).

Spring Boot Autoconfigure

Module to autoconfigure a wide range of Spring projects. It will detect the availability of certain frameworks ( , , , ). When detected it will try to automatically configure that framework with some sensible defaults, which in general can be overridden in an application.properties/.yml file.

Spring Boot Actuator

This project, when added, will enable certain enterprise features (Security, Metrics, Default Error pages) to your application. Like the auto configure module it uses autodetection to detect certain frameworks/features of your application.

Spring Boot Starters

Different quickstart projects to include as a dependency in your or build file. It will have the needed dependencies for that type of application. Currently, there are starter projects for a web project ( and based), , , , exist. Many more have been added over the years and the full list can be found here.

Spring Boot Tools

The and build tool, as well as the custom Spring Boot Loader (used in the single executable jar/war), is included in this project.

143171 questions
121
votes
7 answers

Spring Boot how to hide passwords in properties file

Spring Boot uses the properties file, and at least by default, the passwords are in plain text. Is it possible to somehow hide/decrypt these?
user1340582
  • 19,151
  • 35
  • 115
  • 171
121
votes
5 answers

Spring MVC or Spring Boot

For a large company (web) project, do you recommend using Spring MVC or Spring-Boot? Spring-Boot, in terms of configuration, is very easy compared to Spring MVC. I wonder if I use Spring-Boot can have the same advantages of Spring MVC? What do you…
Diego
  • 2,395
  • 2
  • 21
  • 27
121
votes
9 answers

How do I run a spring boot executable jar in a Production environment?

Spring boot's preferred deployment method is via a executable jar file which contains tomcat inside. It is started with a simple java -jar myapp.jar. Now, I want to deploy that jar to my linux server on EC2, am I missing something or do I really…
Cleber Goncalves
  • 1,936
  • 3
  • 18
  • 23
120
votes
10 answers

Call another rest api from my server in Spring-Boot

I want to call another web-api from my backend on a specific request of user. For example, I want to call Google FCM send message api to send a message to a specific user on an event. Does Retrofit have any method to achieve this? If not, how I can…
Mahdi
  • 6,139
  • 9
  • 57
  • 109
120
votes
18 answers

How do I configure HikariCP in my Spring Boot app in my application.properties files?

I'm trying to set up HikariCP in my Spring Boot (1.2.0.M1) app so I can test using it in place of Tomcat DBCP. I'd like to configure the connection pool in my application.properties file like I was doing with Tomcat, but I can't figure out how I…
Kevin M
  • 2,717
  • 4
  • 26
  • 31
119
votes
6 answers

Intellij IDEA complains cannot resolve spring boot properties but they work fine

Can not resolve configuration property '... I have no problem accessing my properties through the @Value annotation or through an autowired Evironment. But all of my own defined properties get this warning in IDEA. What should I be doing to get…
Stoopkid
  • 1,885
  • 2
  • 17
  • 30
119
votes
5 answers

Missing CrudRepository#findOne method

I am using Spring 5 in my project. Until today there was available method CrudRepository#findOne. But after downloading latest snapshot it suddenly disappeared! Is there any reference that the method is not available now? My dependency list: apply…
Andrii Abramov
  • 10,019
  • 9
  • 74
  • 96
119
votes
6 answers

HikariCP - connection is not available

We have Spring-boot/Hibernate/PostgreSQL application in our project and use Hikari as the connection pool. We keep running into the following problem: after few hours active connections number grows to the limit and we get the errors like this (full…
dfche
  • 3,403
  • 2
  • 24
  • 32
119
votes
4 answers

Environment Specific application.properties file in Spring Boot application

In my Spring Boot application, i want to create environment specific properties file. The packaging type of my application in war and i am executing it in embedded tomcat. I use sts and execute the main from sts itself. Can i have environment…
user3534483
  • 2,133
  • 5
  • 22
  • 19
119
votes
9 answers

How to pass JVM options from bootRun

I'm developing simple Spring web application that communicates with remote host and I would like to test it locally behind corporate proxy. I use "Spring Boot" gradle plugin and the question is how can I specify proxy settings for JVM? I have try…
Evgeny
  • 1,413
  • 2
  • 12
  • 16
118
votes
11 answers

Intellij maven project Fatal error compiling: invalid flag: --release

I am trying to start with Spring-boot, Maven in Intellij Please help me I am getting the error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project spring-rest: Fatal error…
Aminul
  • 1,427
  • 2
  • 8
  • 16
118
votes
1 answer

Maven resource filtering not working - because of spring boot dependency

In a maven project I trying to replace some tokens using maven resource filtering but it does not work. I have some other projects which works but does not work in this single project not sure what is wrong. The property files is in location…
Jay
  • 9,189
  • 12
  • 56
  • 96
117
votes
9 answers

Spring: overriding one application.property from command line

I have an application.properties file with default variable values. I want to be able to change ONE of them upon running with mvn spring-boot:run. I found how to change the whole file, but I only want to change one or two of these properties.
clueless user
  • 1,301
  • 2
  • 11
  • 12
117
votes
14 answers

How to debug Spring Boot application with Eclipse?

My Spring Boot webapp is running just fine, and I'd like to debug it through Eclipse. So when launching my Remote Java Application debugger, which port should I listen to? And is there a setting on my webapp I have to set to enable debugging?
JeffLL
  • 1,875
  • 3
  • 19
  • 30
117
votes
8 answers

exclude @Component from @ComponentScan

I have a component that I want to exclude from a @ComponentScan in a particular @Configuration: @Component("foo") class Foo { ... } Otherwise, it seems to clash with some other class in my project. I don't fully understand the collision, but if I…
ykaganovich
  • 14,736
  • 8
  • 59
  • 96