How do I get my Eclipse-Maven project to automatically update its classpath when I change a dependency in my pom.xml file?

前端 未结 5 2038
轻奢々
轻奢々 2020-12-01 14:36

I’m using Eclipse Mars with Maven (v 3.3). When I update a dependency in my pom (change the version), my Eclipse-Maven project doesn’t pick it up, even when I right click m

5条回答
  •  广开言路
    2020-12-01 15:26

    Eclipse should be updating your classpath. If it's not, that implies something is going wrong.

    It's hard to say what the problem could be exactly without knowing more about your project's pom.xml. More information might be necessary to solve the issue, but I'll just make a stab in the dark:

    Open the .project file in your project's root folder and check the ordering of builders and natures there. It might be possible that some other nature on the project is also causing maven2Nature to fail. Move maven nature up and see if that helps any.

    Alternatively you might be thinking that Eclipse does not update your dependencies because it does not add some some error indicators in the project that should be there with new dependencies. If that's the case try cleaning the current project (project>clean...). Maven in Eclipse does not necessarily trigger a full rebuild when dependencies are updated.

    If none of this works, closing/opening the project might solve the issue quicker than re-importing.

提交回复
热议问题