简体   繁体   English

Eclipse - Maven不会自动为项目添加依赖项

[英]Eclipse - Maven does not add dependencies to project automatically

After installing Eclipse on my new laptop I have not been able to have Eclipse download/display the dependency folder of a newly created project ( http://prntscr.com/cg378c ) without manually adding the following lines into the projects .classpath file 在我的新笔记本电脑上安装Eclipse之后,我无法让Eclipse下载/显示新创建项目的依赖文件夹( http://prntscr.com/cg378c ),而无需手动将以下行添加到项目.classpath文件中

    <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
      <attributes>
          <attribute name="maven.pomderived" value="true"/>
          <attribute name="org.eclipse.jst.component.nondependency" value=""/>
        </attributes>
    </classpathentry> 

After I manually add these lines to the file and update the maven project the dependencies are always updated automatically and such. 手动将这些行添加到文件并更新maven项目后,依赖项始终自动更新等。

On my old Eclipse setup this was not an issue, so I am not sure what I did this time around to mess this up. 在我的旧Eclipse设置上,这不是问题,所以我不确定这次我做了什么来弄乱它。 All of my system variables are set and I have the m2e plugin installed along with the following maven installation(s) ( http://prntscr.com/cg38gv ). 我的所有系统变量都已设置,我安装了m2e插件以及以下maven安装( http://prntscr.com/cg38gv )。

I've tried to uninstall Eclipse fully but when I re-install it for some reason all of the plugins, including m2e, are still there. 我已经尝试完全卸载Eclipse,但是当我因某些原因重新安装它时,包括m2e在内的所有插件仍然存在。

How can I get Eclipse to automatically add the dependencies when I create a new project? 在创建新项目时,如何让Eclipse自动添加依赖项? Thanks! 谢谢!

I removed the maven installation from my computer and completely re-installed eclipse yet again and now for some reason it is working. 我从我的计算机上删除了maven安装并再次完全重新安装了eclipse,现在由于某种原因它正在运行。 I guess my maven installation had an issue since that's the only difference between this re-installation and the previous one. 我想我的maven安装有一个问题,因为这是重新安装和前一个安装之间的唯一区别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM