For example, suppose you have a repository called ʻA
and you have a library called ʻauth-shared that is commonly used by multiple projects set as a dependency.
If you normally open a repository called ʻA
in IntelliJ, ʻauth-shared will be imported as an external library, and if you want to modify ʻauth-shared
, open the ʻauth-shared project, modify it, and
maven install You have to do something likeand reload with ʻA`, which is inconvenient when you want to fix it frequently or when you want to make trial and error.
By the method described below, in such a case, you can open ʻA
and ʻauth-shared in the same project, and as soon as you modify ʻauth-shared`, you can see the modified behavior.
From the IntelliJ menu "File"-> "Module from Existing Sources ...", select the root directory of the module you want to add to your project or pom.xml for Maven.
Project Structure-> Modules-> Select Dependent Modules-> Dependencies tab-> Press "Module Dependency" from the "+" button to add it as a dependency.
The upper part of the list of Dependencies is referred to preferentially, so move the added dependency to a position higher than the original dependency (on Mac, it is easy to move it with ʻOption + ↑ `).