[英]Intellij Maven Dependency is not able to imported
我正在嘗試使用 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 ,但我仍然遇到同樣的錯誤。
我想知道為什么會發生這種情況以及如何解決。
這對我有用:File -> Invalidate Caches/Restart,然后 Build -> Rebuild project
然后我可以導入 JDABuilder 或其他類。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.