0
votes

How to differentiate between jars of same version present in local maven repo and artifactory.

Say for example sample-1.0.jar is present in local maven repository and also the same resides in artifactory but with latest code.

I need the jar(with latest code) from artifactory during maven build.(without clearing the local repo)

2

2 Answers

0
votes

Please try with -U command while making the build. This is for force updating the local repo. this may help you

0
votes

There is no way you can do it. That's because the assumption is - you shouldn't have two different binaries under the same version (except of snapshots). Both Maven and Artifactory operate under this assumption and there is no way to override it.

Bottom line:

  1. Don't have different binaries under same version.
  2. the only way is to clean local repo (you might of a maven plugin to do that if you can't fix the problem with conflicting binaries).