Как переименовать проект в intellij idea

от admin

Rename a Spring Boot Maven Project in IntelliJ

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):

Renaming a project in IntelliJ IDEA

I have some projects where the directory containing the project is called «Code».

When I open IDEA, in my recent projects list all I see is that name.

Is there any method to change this in settings ?

I tried going to File->Project Structure->Project, I couldn’t find the Project Name option in IntelliJ IDEA 13.

I see this in my project settings.

vikingsteve's user avatar

15 Answers 15

You can change the project name, which is the name that is shown in the recent projects list, like so:

Go to Project Structure ( Ctrl + Alt + Shift + S ) → Project Settings / Project → Project name:

enter image description here

Please note that this is not to be confused with name of the root module, or folder on the file system, which may or may not be similar.

Edit

Please try going into your .idea folder in the project, create a file named .name and enter a project name on a single line.

Then restart IntelliJ.

This presumes you are using a folder-based Idea project in .idea (rather than file based, with .iws file etc)

DimaSan's user avatar

vikingsteve's user avatar

Meanwhile I talk about IntelliJ 2016.2.

There are various names involved.

  1. Red the folder name. I.e., the folder where the project is located. This name appears the the project structure and in the path on the top window.
  2. Blue the name of the iml file. You can rename the iml file, when the iml file is different from the folder name, you have them both in the project view.
  3. Yellow the project name can be set as described by @vikingsteve (Project Structure (ctrl-alt-shift-s) -> Project Settings / Project -> Project name) in the response above. You will find the project name written in the file ".name" in the .idea folder. It is also the name which appears in the open recent file list.
  4. brown if your project is a maven project, you will additionally have the artifact id in the pom.

Usually all these names are the same which makes life easier.

Sometimes they are not. There are many reasons why they should be different. E.g., this helps me to differentiate project versions (I also use the image background feature of IntelliJ 2016.2) when I have simultaneously the same project on two branches.

While you change these names, IntellJ may generate a new *.iml with the artifactId name (brown). In this case just delete the *.iml file you don’t want to keep.

screenshot

Basil Bourque's user avatar

fan's user avatar

Following are the steps to be followed in IntelliJ Idea Community Edition:

Go to File >> Project Structure >> Project > Project Name Update project name with its new name.

Go to pom.xml Update project name with its new name in the

Select «Project» view and click root folder of the project then refactor its name.

Exit IntelliJ Idea and Rename root folder name in the windows directory structure where this project repository is stored.

Restart IntelliJ Idea and import the project using «Import project from existing resource» option.

Tips for renaming a Gradle project

Exit IntelliJ IDEA

Edit contents of the following files /settings.gradle /.idea/.name

Open IntelliJ IDEA

Refresh Gradle Project

roblogic's user avatar

Am using intellij 2017.2.6

Go to project view

Right Click on the top root element

Choose Refactor-> Rename

Small dialog appear -> enter the desired name

image 1

enter image description here

Actually this is a maven project and its name is defined from the maven pom.xml So if you want to change the name you need to change its name in pom.xml
from

This worked for me:

  1. Renamed module folder
  2. Updated module name in settings.gradle
  3. Updated all build.gradle references
  4. rm -rf .idea/modules/[module]
  5. Rebuild project

intellij project structured in folder

I completed the renaming as below.

The attached image is structured in project folder.

Must make changes in the xml into a new project name.

close IDEA intellij (14.0.2)

change intellij project name (folder)

e.g) old_project_name -> new_project_name

change .idea in folder

Читать:
Как найти периметр окружности по радиусу

We have only changed the

1) artifacts in folder -> xml

2) runConfigurations in folder -> xml

(Depending on your project structure, your folder may not contain xml )

restart IDEA intellij

File -> Import Module. [your intellij project]

I hope this helps you 🙂

  1. Rename project in project tree view
  2. Rename project folder in project files tree view
  3. Rename artifactId and id in pom.xml (if maven is used)

BaiJiFeiLong's user avatar

Once you have changed the project name by following the other suggestions mentioned in this thread, you can also change the module name within the project settings -> Modules:

enter image description here

This will change the name that is included within the brackets just next to the name of the project:

enter image description here

After this, proceed to refactor and rename the class that contains the main method to match your new project name. (This class is normally auto-generated by intelliJ after creating a new project).

That should do it. Cheers!

Israelm's user avatar

If your project is file based, you cannot rename the project from within IDEA.

Convert your project to a directory based format, and then you will have the option to rename it under «File > Project Structure > Project > Project Name».

Nathan's user avatar

For Gradle Springboot intellij project:
1. settings.gradle :
rootProject.name = ‘new-name-project’
add/edit the above line at the bottom of the page
2. application.properties
spring.application.name=new-name-project
add/edit the above line at the top of the page
3. Go to file > project stricture > Project> Project-name: new-name-project
4. Apply and restart Intellij

I recently figured out a way to do this.

I wrote a bash script that you run from the root folder of your project (only tested on Mac) to rename all of the files in the .idea folder that contain your project name, and do a find-replace inside those files.

BE CAREFUL: Make sure your project name is unique — i.e., a project name like ‘towers-of-hanoi’ is unique and the script will have no problems, but a project called ‘a’ will, as all instances of ‘a’ in the files will be replaced with the new project name.

UPDATE IntelliJ 2021.2.3 (complete, including maven)

Covers the project, maven configuration (including multi-module), and file system folder. Eliminates project name in brackets in project view.

Русские Блоги

Иногда я не могу изменить это много раз, поэтому мне просто нужно прочитать это
использует проект, созданный gradle
сначала

  • Найдите это в проекте, а затем измените имя проекта, которое вы хотите в нем
  • Изменить имя здесь
  • Тогда файл-> структура проекта
  • Затем закройте проект, перейдите в локальную папку и измените имя папки, в которой находится проект.
  • Перезапустить идею
  • ok

Интеллектуальная рекомендация

Реализация JavaScript Hashtable

причина Недавно я смотрю на «Структуру данных и алгоритм — JavaScript», затем перейдите в NPMJS.ORG для поиска, я хочу найти подходящую ссылку на библиотеку и записывать его, я могу исполь.

MySQL общие операции

jdbc Транзакция: транзакция, truncate SQL заявление Transaction 100 000 хранимая процедура mysql msyql> -определить новый терминатор,Пробелов нет mysql>delimiter // mysql> -создание хранимой .

Используйте Ansible для установки и развертывания TiDB

жизненный опыт TiDB — это распределенная база данных. Настраивать и устанавливать службы на нескольких узлах по отдельности довольно сложно. Чтобы упростить работу и облегчить управление, рекомендуетс.

Последняя версия в 2019 году: использование nvm под Windows для переключения между несколькими версиями Node.js.

С использованием различных интерфейсных сред вы можете переключаться между разными версиями в любое время для разработки. Например, развитие 2018 года основано наNode.js 7x версия разработана. Тебе эт.

Шаблон проектирования — Создать тип — Заводской шаблон

Заводская модель фабрикиPattern Решать проблему: Решен вопрос, какой интерфейс использовать принципСоздайте интерфейс объекта, класс фабрики которого реализуется его подклассом, чтобы процесс создания.

IntelliJ IDEA: как переименовать проект (в списке «последние проекты»)?

есть ли простой способ в идее 12 переименовать проект в списке «последние проекты»?

8 ответов:

нашел решение.
Вы можете переименовать проект в разделе «файл > структура проекта > Проект > имя проекта».

enter image description here

Если ваш проект основан на файлах, вы не можете переименовать проект из IDEA.

преобразуйте свой проект в формат на основе каталога, а затем у вас будет возможность переименовать его в разделе «файл > структура проекта > Проект > имя проекта».

Это было сделано только на 14 ultimate.

просто отредактируйте файл, содержащий имя: .idea/.name .

  1. закрыть проект идеи
  2. найти файлы проекта *.ПИС.* ,iml,*.ИВС
  3. переименовать все эти файлы, как вы хотите быть назван проект, например, новый проект.ipr (iml,iws)
  4. открыть файл проекта в IDEA
  1. измените имя папки проекта
  2. найти и переименовать .ipr файл, предложенный @Ernest
    • Примечание: у меня не было .iml , ни .iws file
  3. изменить имя в .idea/.name
  4. заменить все вхождения для начального проекта имя по новому во всех .xml файлы

    • найти их с помощью:

    find . -name «*.xml» -exec grep -Hn $InitProjectName <> \;

  1. Выберите Имя Проекта.
  2. Выберите Рефакторинг->Переименование
  3. ввод нового проекта.

intellij project structured in folder

Я завершил переименование, как показано ниже.

прикрепленное изображение структурировано в папке проекта.

необходимо внести изменения в xml в новое имя проекта.

Похожие статьи