Renaming a project in IntelliJ IDEA

前端 未结 13 1358
無奈伤痛
無奈伤痛 2020-12-07 14:48

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 t

13条回答
  •  隐瞒了意图╮
    2020-12-07 15:06

    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.

提交回复
热议问题