Renaming a project in IntelliJ IDEA

2019-01-21 21:43发布

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.

This is what I see when I open Project Settings I see this in my project settings.

11条回答
Fickle 薄情
2楼-- · 2019-01-21 22:00

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
查看更多
时光不老,我们不散
3楼-- · 2019-01-21 22:03

Tips for renaming a Gradle project

  1. Exit IntelliJ IDEA

  2. Edit contents of the following files {project_root}/settings.gradle {project_root}/.idea/.name

  3. Open IntelliJ IDEA

  4. Refresh Gradle Project

查看更多
Luminary・发光体
4楼-- · 2019-01-21 22:09

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.

  1. close IDEA intellij (14.0.2)

  2. change intellij project name (folder)

    e.g) old_project_name -> new_project_name

  3. change .idea in folder

We have only changed the

1) artifacts in folder -> xml

2) runConfigurations in folder -> xml

3) modules.xml

4) workspace.xml

5) [your_project_name].iml

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

  1. restart IDEA intellij

  2. File -> Import Module...[your intellij project]

I hope this helps you :)

查看更多
\"骚年 ilove
5楼-- · 2019-01-21 22:14

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

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

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

  3. Select "Project" view and click root folder of the project then refactor its name.

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

  5. Restart IntelliJ Idea and import the project using "Import project from existing resource" option.

查看更多
叛逆
6楼-- · 2019-01-21 22:15

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.

IntelliJ project name

查看更多
成全新的幸福
7楼-- · 2019-01-21 22:15
  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)
查看更多
登录 后发表回答