How to add multiple dependencies with the Spring CLI

How do you add multiple dependencies when creating a new project with the Spring CLI

In this tutorial, we are taking a look at a student’s question from my Spring Boot Introduction Course. This question has to do with the Spring CLI which is a great tool that allows you to quickly prototype with Spring. 

Spring CLI

Hi Dan,
I have created the spring boot application through spring CLI in the same way you showed in the video but my question is, How can we add multiple dependencies in our application through spring CLI? You have shown it for only one dependency i.e “web” using -d option but what if we want to add more dependencies through CLI?
In this article, I am going to talk through what the Spring CLI, how to install it and use it and of course answer the question above. 

3 YouTube Channels for Java Developers

A quick look at 3 YouTube Channels I think you should subscribe to right now

I think if I was given the choice to only keep a single website around I would have to go with YouTube. I love it for both entertainment and education and I love creating content on my channel. 

YouTube

I am going to share with you 3 YouTube channels I think you should subscribe to. The reason I chose these 3 is that they have all put out some really great content lately. 

How to kill Java process on mac OS Sierra using Activity Monitor

Using Activity Monitor to kill Java Process on mac OS

Last week I wrote an article on the improvements in Spring Boot 1.4 of startup errors. Specifically, we saw that we got a really informative error message when we try and run an application and port 8080 is already in use. 

I received a question from a reader that went like this 

“I get the port 8080 is already in use error from time to time and I am not sure how to fix it, what can I do?” 

This is actually pretty easy to fix and happens to all of us. In this short article, I will show you how to do it on macOS and link to another article I wrote on how to do this on Windows. 

Spring Data Aggregate Functions in a repository

A quick demo on how to use aggregate functions in your Spring Data Repository

In this tutorial, we are taking a look at a student’s question from my Spring Boot Introduction Course

Aggregate Functions

Hi Dan,
How can I use the @Query to specify an aggregation function in a select statement like…
“select post_date, sum(value) from post group by post_date”
retrieve it to a DTO and show on screen?

This is actually pretty easy to do using the @Query annotation. In this tutorial, I will show you how to do this using JQL and native SQL. 

How to use HikariCP in your next Spring Boot project

HikariCP is the fastest, most reliable JDBC connection pool around

Performance is something we are all trying to improve on when it comes to our applications. It turns out that there is a very reliable, high performance JDBC connection pool out there that we can start using in our Spring Boot applications today. 

HikariCP is the fastest connection pool around.

In this article, we are going to take a look at HikariCP, the CP standing for a connection pool. HikariCP is a “zero-overhead” production-quality connection pool.

Spring Boot Application Failed To Start

The Tomcat connector configured to listen on port 8080 failed to start.

Errors are a part of the development lifecycle and there is no way getting around them. I know we all like to think we are top notch coders and that we are error prone but I can assure you that isn’t the case. 

Application Failed To Start

When errors come up it is nice to have as much information at our disposal as possible. We don’t have time to search the web for hours of cryptic stack messages to find our solution. In this article, I am going to show you an error you might come across and how Spring Boot 1.4 has made it a little bit easier to decipher error messages. 

How to read JSON data in Spring Boot and write to a database

We are going to read in some JSON data and map it to our Spring Boot Domain Object.

In this tutorial, we are taking a look at a student’s question from my Spring Boot Introduction Course

How can I read in a JSON file in Spring Boot and save the records to a database?

JSON

If you have ever had to read and write JSON data you know that this can be tricky. First, you have to read in the JSON data and mapping that data to your domain model isn’t always easy. Once you have that in place you need to take that data and save it off to a database. In this tutorial, we will look at a quick and easy way to do this in Spring Boot.

Multiple Request Mappings in Spring Boot

How can we define multiple request mappings for a single method?

In this tutorial, we are taking a look at a student’s question from my Spring Boot Introduction Course. The question was related to building out Spring Controllers and how to define multiple request mappings for a single method.

Request Mappings

“How can I create multiple request mappings for a single method?”

Deploying a WAR to an application server in Spring Boot

How can we package our application as a WAR file and not a JAR?

In this tutorial, we are taking a look at a student’s question from my Spring Boot Introduction Course. We might not realize it but when we start a new project we are selecting how we want to package this application when we ready to go live. 

Spring Boot: Package as WAR

I recently received the following question from a student: 

In the real world, an application will be deployed to an application server like JBoss. How can the application be wrapped into a war file and deploy to the application server?

Thank you for the question and now let’s dive into the answer. 

Spring Boot Configuration using YAML

In this tutorial, we are going to look at a question from a student in my Spring Boot Introduction course. This question had to do with using a YAML file for configuration and the best way about how to inject a single property for multiple environments. 

Spring Boot YAML Configuration

Let’s take a look at the question and then we will talk through the solution. 

Hi!
How can I access these properties from a single yml properties file in the DataSourceConfig? Thanks.