Using maven to connect to a local project

I have two projects in eclipse:

  • Structure
  • : A shared library used in several projects.
  • client: a project that uses framework .

client quite large, perhaps more than the framework . I use client as a kind of test device for the framework . I want to make some changes to the framework and test them in client . Currently, I have to complete the build of the framework , install it in the maven repository, and then rebuild the client .

Is there a way to simply client point to the framework directly on my local drive? Any other hints of development in such a situation (i.e. the best way)?

+6
source share
3 answers

You can specify local disk dependencies using <systemPath> like this:

 <dependency> <groupId>example.logging</groupId> <artifactId>commons-logging</artifactId> <version>1.0.0</version> <scope>system</scope> <systemPath>${project.basedir}/lib/commons-logging.jar</systemPath> </dependency> 

I'm not sure if you can point to a directory that has pom in it, but at least you don't need to deploy it to maven.

+6
source

Running mvn install in the Framework will build it and install it in the local Maven repository (i.e. Maven repositories on the local drive). When you run your tests in Client, Maven automatically uses the version of Framework in your local repository.

+21
source

The m2eclipse plugin is pretty smart about Maven dependencies. If you have a framework dependency as a separate project in Eclipse, I think that it should use its code for client , not the version in your repository. You may need to tweak the project settings if you are already using m2eclipse and it does not.

+3
source

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


All Articles