I have a multimodule maven project. the service module depends on domain module using dependency tag. Every time i build the service module, i want it to automatically build the domain module and pick up the most recent domain module from local repository. How can I do it. Right now it pick from the local repository but that may not be the latest copy.
I build the project from my service module dir and not from the parent directory. Because my parent module has lot of other submodules that I am not interested in building.
In Maven, you can use Apache Maven Dependency Plugin, goal dependency:purge-local-repository to remove the project dependencies from the local repository, and re-download it again.
Force maven to fetch dependencies from the remote repository while building the project. We can use -U/--update-snapshots flag when building a maven project to force maven to download dependencies from the remote repository.
It only cleans the project. Show activity on this post. Show activity on this post. With the help of Purging local repository dependencies you need to do that.
One thing you can possibly do is to build the service module
from the parent directory
with the following parameters.
mvn compile -pl service-module -am
What this does is builds only the service module
, along with its dependant modules (which would include the domain module
).
The options are described by mvn --help
(Maven 2.2.0):
-am,--also-make
If project list is specified, also build projects required by the list
-pl,--projects <arg>
Build specified reactor projects instead of all projects
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With