How to make IntelliJ a link to a local project for dependency?

Working in a multi-module Maven project, call it an “application.” I need to work with the source of one of the dependencies, call it "lib" and be able to easily test / debug the "application" against my changes in "lib".

In Eclipse, this is an option for its Maven and Gradle plugins, and this is obvious since Eclipse does not connect the concepts of “workspace” and “project” as much as IntelliJ. When I cloned the repo for "lib", IntelliJ suggested creating a new project for it, but how to make the "application" use the local working copy of "lib" for compilation and runtime?

In other words, can IntelliJ encapsulate execution build installin "lib" behind the scenes so that the "application" uses the updated (snapshot)?

+4
source share
1 answer

The obvious, cleanest choice would be to combine the two projects into a common Maven multi-pom project. If this is something you cannot do (perhaps the projects belong to different teams, etc.), then I could imagine that you could fake it using symbolic links.

Create a shell project with just a pom file and two modules. Instead of folders for modules, use symbolic links to actual file locations. Obviously, the root root of the reactor would not be the parent pom.

pom IntelliJ.

, , .

0

Source: https://habr.com/ru/post/1659759/


All Articles