1

My project depends on a module in my private repository, but when somebody changes the module and deploys my local project, I can not update the dependency. But, if the module is local, when I change it and install my local project I get the latest dependency.

What I want to know is how does maven judge that a module or jar in private repository is changed or not and a dependency with the same version needs to be update?

I hope my broken English is clear enough.

Martin Evans
  • 45,791
  • 17
  • 81
  • 97
youyou
  • 11
  • 3
  • How have you defined the version of that module in your pom file? – khmarbaise Apr 28 '17 at 08:38
  • I define it with a usual released version, from the answers I know how maven works .And it is a good way to define a SNAPSHOT version. – youyou Apr 28 '17 at 14:07

2 Answers2

0

Your problem is that you're not updating the version in the repository. When running, maven compares the versions of the remote and local file, and updates the local one if the remote one is newer. It always takes the version from the local repository, after updating if needed.

jwenting
  • 5,505
  • 2
  • 25
  • 30
0

Maven has no idea that a module has changed, unless someone changes the version of the module each time the module changes. Which of course will not result in any update unless you also change the version that you require in your pom.xml.

Unless, your module is a SNAPSHOT version. Now, you said nothing about SNAPSHOT in your question, so this probably does not apply to you. But if you want to know what's different with SNAPSHOT versions, you might want to read this: https://stackoverflow.com/a/5907727/773113

Community
  • 1
  • 1
Mike Nakis
  • 56,297
  • 11
  • 110
  • 142