1

I'm trying to understand how does maven knows which jar to prefer when it comes to a jar that was installed by me manually (using mvn install) and there is a newer version in the repo of that jar. The version for both jar is -SNAPSHOT.

For example: I have 2 projects, core and application. Core has the version 1.0.0-SNAPSHOT and application has a dependency on that version.

From my computer I've compiled and installed my changes in core in order to test them in the application project.

A team mate has also changed things in core and deployed his version to our local repo.

When I'm doing mvn update, i'm not getting his changes.

Is that the normal behavior of maven?

Hugo y
  • 1,421
  • 10
  • 20
Tzach Solomon
  • 688
  • 8
  • 27
  • As I understand this, this is not a perfect duplicate since it does not describe the scenario where some one use a JAR that was installed using mvn install (meaning manually) by the developer and then, that developer is trying to update. Why should maven prefer the version in the repo and thus ignoring my changes? – Tzach Solomon Nov 15 '15 at 09:14
  • Possible duplicate of [What exactly is a Maven Snapshot and why do we need it?](https://stackoverflow.com/questions/5901378/what-exactly-is-a-maven-snapshot-and-why-do-we-need-it) – SiKing Jun 19 '18 at 19:37

1 Answers1

2

If you build your project with the -U switch, you will force Maven to search remote repositories for udpated snapshots and releases.

https://books.sonatype.com/mvnref-book/reference/running-sect-options.html