Rename a Spring Boot Maven Project in IntelliJ

Nil Seri
3 min readSep 26, 2021

--

Steps to Rename Your Spring Boot Project in IntelliJ IDEA

Photo by Matt Hudson on Unsplash

In this example, I am going to rename my project named “spring-cloud-config-server” to “config-server” in IntelliJ IDEA (currently, its latest version is 2021.2.1).

Right click on your project, click Refactor -> Rename

After you click, since you are at the project level, three options show up. We will select “Rename module and directory” (we aim to change project’s name in IntelliJ as well as folder name in project directory).

After the operation, we still have places (like pom, main/test directories, project name in application.properties) to update our project’s name as you can see:

Go to src/main/java/yourprojectname folder, right click and select Refactor->Rename.

There appears a warning to apply this change to “test” as well as “main” folder:

We update package name in “Rename” window:

A “Refactoring Preview” window shows up:

There is a button on the right below to go on with the changes and we click on that after reviewing.

Right click on our main Application class to rename (Refactor->Rename):

Let’s update in application.properties.

We also should update in pom.xml file (artifactId and name):

Last but not least, right click on your pom.xml file and Run Maven->Reimport:

Voilà!

Happy Coding!

--

--

Nil Seri
Nil Seri

Written by Nil Seri

I would love to change the world, but they won’t give me the source code | coding 👩🏻‍💻 | coffee ☕️ | jazz 🎷 | anime 🐲 | books 📚 | drawing 🎨

Responses (1)