How to install build dependencies between Maven projects in Eclipse?

I am new to Maven and I could not find a solution to this little problem (IMHO).

In my Eclipse workspace, I have a Maven project for the OSGi package (regular, not Eclipse plugin). It depends on a few artifacts (JAR libraries); I need one of them to be built from another Maven project in the workspace. When I rebuild the package, I would like Maven to check if another artifact needs to be rebuilt (i.e. because I edited part of its code), and if so, rebuild it too. That way, I can automate some of the steps and remember to rebuild the internal library. How to do it?

Thanks for any help!

Enrico

+3
source share
2 answers

There may be several ways. You can start with maven modules.
http://maven.apache.org/guides/mini/guide-ide-eclipse.html#Multiple_Module_Project

+1
source

Since you are using m2eclipse, you can configure m2eclipse to use "workspace resolution", i.e. Use a project from your workspace as a dependency instead of a binary dependency (JAR).

Thus, the changes are immediately visible.

+1
source

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


All Articles