I have a project which has dependency A. Project is packing into WAR and dependency A - into jar. And another dependency B, which also depends on A. I want to pack project and when project B is packing it must rebuild its dependency A instead of getting compiled dependency. Please help, how can i achieve this
We can force update in maven by using –U options by using mvn clean install command. In that –U means force update the dependencies of the snapshot. The release dependencies are updated is suppose there are not updated previously.
mvn clean do not clean your repository. It only cleans the project. Save this answer.
Just open eclipse-->window-->preferences-->maven-->user settings-->in there see "local repository location". then find the location for your . m2/repository folder then delete that folder if your maven doesn't work properly.
What you may want is a multi-module project containing your three projects (WAR, A and B). Then you can run mvn package on the multi-module project and it will build and package all of the latest project code against each other without having to run mvn install to update the dependencies in your local repository first.
Always perform a clean when doing an install, ie mvn clean install
. This will make sure that all modules in the project are rebuilt, packaged, and installed in the local .m2 repository for inclusion by parent dependencies and 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