Search code examples
javaintellij-ideaintellij-plugin

Intellij: refactor across separate projects - plugin or pull request?


I have two Java projects, App and Lib. App depends on Lib, yet they are in different repositories.

I would like to have them both open in the same Intellij window, refactor a constant within Lib, and have that applied in App as well.

I am wondering what is the best way to approach this: implementing the function in Intellij src and submit a PR or creating a plugin.

My preference would be to create a plugin because the PR may not be accepted. At the same time, I would like to avoid implementing refactoring if I can, my intention is just to extend Intellij's refactoring scope to include all open projects. Not sure if a plugin can just override application functionality.

Edit: Maven is used for dependency management.


Solution

  • What I ended doing: I created a third project to act as a parent, checked out both app and lib as github submodules and then modified the parent pom to also include them as modules. Both projects are visible from Intellij, refactoring works and projects remain independent in their respective repos.