简体   繁体   English

如何使JetBrains Intellij IDEA 13将Git导入的项目识别为Maven项目?

[英]How can I make JetBrains Intellij IDEA 13 recognize a Git imported project as a Maven project?

I have been having trouble with IDEA ( JetBrains Intellij IDEA 13 ) not reading the pom.xml file after the project has been imported using the VCS . 使用VCS导入项目后,IDEA( JetBrains Intellij IDEA 13 )无法读取pom.xml文件时遇到了麻烦。 How can I make IDEA recognize this as a Maven project so it gets all the dependencies from the pom.xml ? 如何使IDEA将其识别为Maven project以便它从pom.xml获取所有依赖项?

This is what the pom.xml currently looks like in Project View : 这就是pom.xml当前在Project View样子:

在此处输入图片说明

To test it try this our: 要对其进行测试,请尝试以下操作:

  1. Go to VCS->Chech out from Version Control->Git 转到VCS->从版本控制-> Git中退出
  2. Enter this spring project: https://github.com/SpringSource/spring-mvc-showcase 输入这个春季项目: https : //github.com/SpringSource/spring-mvc-showcase
  3. Select the desired clone path and press "Clone" 选择所需的克隆路径,然后按“克隆”

If everything is working correctly it will ask you to create an Intellij project 如果一切正常,它将要求您创建一个Intellij项目

How can I fix this? 我怎样才能解决这个问题?

  1. Right click the pom.xml file. 右键单击pom.xml文件。
  2. In the menu select " Add as Maven project ", the project will now turn into a Maven project and the pom.xml file icon should turn into an m , the Maven logo. 在菜单中选择“ Add as Maven project ”,该项目现在将变为Maven项目,并且pom.xml文件图标应变为m ,即Maven徽标。

How did it occur? 它是怎么发生的?

This occurs when you don't include the " .idea " folder in the Git repository. 当您不在Git存储库中包含“ .idea ”文件夹时,就会发生这种情况。

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

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