Renaming Maven projects' parent folder loses their Maven project status, and the folders marked as Source Roots etc. get unmarked

I uploaded a small minimal sample, Upload id: 2026_08_16_y3g1BJ1amPUoi743hmGp6j (file: ModulesToShowStatusLossOnRename.zip)

The folder ModulesToShowStatusLossOnRename contains a small subtree with 4 Java modules (Maven projects) across its
2 folders (Folder-A and Folder-B). There is no parent POM.

Folder-A contains 3 modules (Maven projects). When I right-click it in Project view and I rename it, the 3 Maven
projects become no longer Maven projects, f.ex. the Maven icon (the blue "m") at the left of the pom.xml gets
replaced by a "</>" icon, and now if I right-click a pom.xml I have the option "Add as a Maven project", which I am
then forced to use every time I rename the parent folder of those Maven Projects. Also, the subfolders that were
marked as Sources Root, Resources Root etc. lose that status as well.

Furthermore, interestingly, if after doing "Add as a Maven project" to make it become a Maven project again, I rename
the parent folder to what it was before, the modules stay Maven projects - it seems that they lose their status of
Maven projects only if the name to which their parent folder gets renamed is a new name, not the one that that folder
had before.

Also, when I rename the parent folder so the modules lose their status of Maven projects and the subfolders lose their
status of Sources Root, Resources Root etc., and then I immediately rename back that parent folder to what it was
before, the projects automatically regain their status of Maven projects and the subfolders their status of Sources
Root, Resources Root etc.

I must reiterate that I am renaming the parent *folder* that contains the modules under it (Folder-A, Folder-B). I am not
renaming the folder that constitutes the module (TestedModule1, TestedModule2 etc.).

Weird, I know, but I repeated the process several times and I must stand by this description. I also tried this with
Folder-B instead of Folder-A and it's the same.

 

0

Please sign in to leave a comment.