Refactoring

Hi
I need to refactor the package root, say from com.company.inventory .* to com.mycompany.inventory.*

Unless I missed it in documentation by searching the keyword, I didn’t find if there is any option to refactor it. The edit option in studio is not available too. Any suggestions?

Hi
Do not forget to back up your project before such modifications.
You can rename the root package using IntelliJ IDEA as follows:

  1. Open the project in IDEA
  2. In the Project window click the “Gears” icon in the title bar and deselect Compact Empty Middle Package
  3. Find the company folder in the project tree
  4. Right click on it and select Refactor ? Rename
  5. If a dialog appears select Rename all
  6. Specify a new name of folder
  7. Open the “Find in Path” dialog in IDEA (Ctrl + Shift + F) and search all Occurrences of com.company in the project and change it to com.mycompany. As usual modification of the following files required:
  • in the core module: app.properties, spring.xml
  • in the global module: metadata.xml
  • in the gui module: screens.xml, screens descriptors and controllers
  • in the web module: web-screens.xml, web-app.properties, web-spring.xml, also screens descriptors and controllers
  • build.gradle
8. Also modify the project in the ~\.haulmont\studio\projects.xml file 9. Reopen the project in Studio, clean it, redeploy and start the server

Regards.