1

I have a pretty big project that uses a local Maven repository to update libraries. Whenever I have to update the project I sync it with an SVN repo, then I launch a "maven clean -U install" through m2e on Eclipse to update and compile the project.

The problem is that while the newer versions of the libraries are downloaded by Maven, the library references aren't updated and I have to change them manually. Since this project uses a lot of such libraries it's not really the best solution.

None of my friends or colleagues have or ever had this problem, and even a Google search doesn't find much.

EDIT: The references in the pom.xml file are already updated through version control (SVN). It's the references in the Eclipse project which aren't updated. Sorry for not being clear.

Jeff Andonuts
  • 43
  • 1
  • 6
  • 1
    How are your friends doing this? They seemed to have a solution..Apart from that automatically updating versions in your pom will not happen...Apart from that `-U` is only related to SNAPSHOT's...btw. What is a local Maven repository? Can you give a small snippet of how your pom file looks etc. ? – khmarbaise Mar 15 '18 at 11:48

1 Answers1

0

If you want to use latest version of your dependencies use mvn versions:use-latest-releases command. This will update dependency versions in pom.xml. If your pom.xml is under version control you have to check it out(make it writable) before executing this command, because it will modify the file content.

miskender
  • 7,460
  • 1
  • 19
  • 23
  • The references in the pom.xml file are already updated through version control (SVN). It's the references in the Eclipse project which aren't updated. Sorry for not being clear. – Jeff Andonuts Mar 19 '18 at 10:35
  • @JeffAndonuts Did you tried right click on project, maven->update project in eclipse. – miskender Mar 19 '18 at 16:09
  • @SilverShroud17 Yes, I tried but it didn't update the references. We got new laptops at work and after moving the projects now everything suddenly works fine, so I guess this issue is technically solved. – Jeff Andonuts Mar 20 '18 at 09:45
  • Right now I have the same issue, and I have to edit one by one in the buildpath, but it takes too much time, any idea or solution? – zepol Jul 21 '20 at 21:42