Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change top level package name in IntelliJ IDEA?

I have a package structure: com.report.domain.model

I would like to change it to com.reporting.domain.model. When I select RefactorRename on package com.report.domain.model, I only see an option to rename 'model'. I have tried switching between Project view and Package, but to no avail. I know how to make this change in Eclipse via Navigator view, but how can I do the same in IntelliJ IDEA?

like image 494
TastyCode Avatar asked May 26 '13 22:05

TastyCode


People also ask

Can I change package name in IntelliJ?

Rename a package IntelliJ IDEA lists all the packages in your project. Right-click the package you want to rename and from the context menu, select Refactor | Rename ( Shift+F6 ).

How do I know my IntelliJ package name?

Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Package Search.

How do I rename a root module in IntelliJ?

Update Module Name in IntelliJ Now, let's open the project folder in IntelliJ. Then, open the settings. gradle. kts file and rename the rootProject.name to kotlinkafkadynamodemo .

How do I change the source level in IntelliJ?

From the main menu, select File | Project Structure Ctrl+Alt+Shift+S . Under Project Settings, select Modules | Sources. From the Language level list, select the necessary option. To use the project language level, select Project default.


1 Answers

In the Project Window, click on the Gears icon in the title bar Gears icon and deselect "Compact Empty Middle Packages". Then you can separately select the report package and rename it.

See also: http://www.jetbrains.com/idea/webhelp/project-tool-window.html#d242351e401

N.B. As of IntelliJ IDEA 2016.3, there is a bug in the menu and when the option is selected, it has a different label "Hide Empty Middle Packages", see https://youtrack.jetbrains.com/issue/IDEA-168362.

like image 107
jkovacs Avatar answered Sep 30 '22 12:09

jkovacs