How to force a java app to use a local version of a maven dependency?

Viewed 97

I have two separate projects: a java library and a java web app that uses the library as dependency. Both use maven.

In some cases I do changes on both at the same time, and I'd like to configure the java app to use my local version of the library, instead of fetching from maven repository.

My current workflow is the current:

  1. Do the changed on the library
  2. Compile and deploy the library to the local maven repository (mvn clean install)
  3. On the java app, set it offline and run a mvn clean install to update the dependency.

This sounds cumbersome, can someone suggest a smarter approach?

thanks

1 Answers

This is local version. But I guess you need something more than this. Give more details if you need.

<dependency>
<groupId>org.group.project</groupId>
<artifactId>Project</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/project-1.0.0.jar</systemPath>
</dependency>
Related