I am working on 2 Java maven projects A and B, and A depends on B. Both projects are github repositories which I have cloned on my local machine.
I made some changes to B and want to test it out with project A now.
When I run the tests in project A, how do I tell Maven to use my local copy of B rather than download a jar file of B from the internet?
There are few possible ways:
Switch to offline mode with
mvn -o. That way you will be only using local repository.
Build and install new version of B which is only available in local repository e.g.
1.0.1-SNAPSHOT. The update A
pom.xmlto use this new version.
Check out Introduction to Repositories docs to understand what are repositories and how they work.