Switching branches in Git with external dependencies

拥有回忆 提交于 2020-01-14 10:37:19

问题


Has anyone had to deal with the issues of switching git branches in a project that has Maven (or any other external) dependencies? For example, suppose that in one branch I have a maven dependency, and in another I don't (or have a different version required). Would I have to re-import maven dependencies each time I switch branches or is there a better approach?


回答1:


It actually depends on an IDE you're using. I haven't noticed any issue with this when using IntelliJ IDEA. It handles any pom.xml changes on the filesystem level very smoothly.

However, some time ago, when I was using Eclipse, I believe I saw such a problem you're talking about. Then there was a need for reimporting Maven projects to have the IDE aware of Maven model changes. I'm not sure how mature is Eclipse support for Maven nowadays though.



来源:https://stackoverflow.com/questions/30902264/switching-branches-in-git-with-external-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!