【发布时间】:2021-02-20 10:39:09
【问题描述】:
我正在尝试使用 maven 将依赖项导入 Intellij。 我像这样编辑了 pom.xml:
<dependencies>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.2.0_214</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>
我在我的项目中写了下面的代码。
import net.dv8tion.jda.*;
public class main {
public static void main(String args[]) {}
}
结果是..我得到错误:java: package net.dv8tion.jda 不存在
我做了 maven Reload project 和 Invalidate caches,但我仍然遇到同样的错误。
我想知道为什么会发生这种情况以及如何解决。
【问题讨论】:
-
您使用的是哪个版本的 IntelliJ?
-
根据 Ahmed Salem 对此问题的回答stackoverflow.com/questions/20137020/… IntelliJ 版本 2020.1 和 2020.1.1 中存在一个错误
标签: java maven intellij-idea