I have a package structure: com.report.domain.model
I would like to change it to com.reporting.domain.model. When I select Refactor → Rename 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?
Best Answer
In the
Project
Window, click on the Gears icon in the title bar and deselect "Compact Empty Middle Packages". Then you can separately select thereport
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.