为什么 IntelliJ 无法解析 pom.xml 文件?

huangapple go评论57阅读模式
英文:

Why can't IntelliJ resolve the pom.xml file?

问题

使用Maven构建一个Java Spring应用程序。然而,整个pom.xml文件中的依赖关系和类似的每个关键词都显示“无法解析的符号”错误:
为什么 IntelliJ 无法解析 pom.xml 文件?

英文:

Building a Java Spring application, using Maven. However, the entire pom.xml file for dependencies and such had every single keyword give the error "Cannot resolve symbol":
为什么 IntelliJ 无法解析 pom.xml 文件?

答案1

得分: 4

看起来您已将此pom.xml添加为Ant构建文件。

相反,您应将其作为Maven项目文件添加到IDE中。您可以通过从Maven工具窗口中的“添加”选项将其添加进来:

  1. 打开Maven工具窗口。

  2. 在Maven工具窗口中,点击+图标以附加一个Maven项目。

  3. 在打开的对话框中,选择所需的pom.xml文件,然后点击确定。

英文:

Looks like you have added this pom.xml as an Ant build file.

Instead you should add it as a Maven project file into IDE. You can do so by adding it from Maven tool window:

  1. Open the Maven tool window.

  2. In the Maven tool window, click the + icon to attach a Maven project.

  3. In the dialog that opens, select the desired pom.xml file, and click OK.

huangapple
  • 本文由 发表于 2020年10月19日 21:39:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/64428597.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定