Refactoring and Running a Multi-Module Project Named roblaxmod in IntelliJ IDEA EAP

Answered

I have a multi-module Java project in Intellij IDEA EAP Called CNC Machining Service with separate modules for core logic, API integration and UI. When I try to refactor shared utility classes into a new common module and update references in other modules the IDE shows unresolved dependencies and build failures even though the module settings and Gradle configuration look correct. What is the best way to restructure and refresh a multi-module project in IntelliJ so that refactored modules are recognized properly and builds succeed without manual fixes to each file? Thanks in advance.

0
1 comment
Please follow below action plan and see how it goes:

• Define the new module in Gradle
    • Add :common to settings.gradle(.kts)
    • Add implementation(project(":common")) to modules that use it
• Use Gradle as the source of truth
    • IntelliJ → Settings → Gradle
        ○ Build and run using: Gradle
• Move code using Refactor
    • Use Refactor → Move (F6) to move utilities into :common
• Reload Gradle project
    • Gradle tool window → Reload All Gradle Projects
• Clean + build with Gradle
    • Run clean then build from the Gradle tool window
• If still broken
    • File → Invalidate Caches and Restart
• Last resort (very reliable)
    • Close IDE → delete .idea/ and *.iml
Re-import the project from the root build.gradle
0

Please sign in to leave a comment.