Discord JDA 依赖缺失

Discord JDA dependency missing

我正在尝试构建一个 discord 应用程序,但由于某种原因它无法访问 JDA。这是错误:

The POM for net.dv8tion:JDA:jar:3.6.2_362 is missing, no dependency information available

编辑:这是我的 POM:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycompany</groupId>
    <artifactId>DiscordBot</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>net.dv8tion</groupId>
            <artifactId>JDA</artifactId>
            <version>3.6.2_362</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>jcenter</id>
            <name>jcenter-bintray</name>
            <url>http://jcenter.bintray.com</url>
        </repository>
    </repositories>
</project>

根据 JDA's README 目前的最新版本是 3.6.0_362 而不是 3.6.2_362,因此您可能需要更改它。

下面是一个 JDA maven pom 文件示例

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>DiscordBot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>bot</name>
<description>General purpose bot</description>
<dependencies>
    <dependency>
        <groupId>net.dv8tion</groupId>
        <artifactId>JDA</artifactId>
        <version>3.6.0_362</version>
    </dependency>
    <dependency>
        <groupId>com.jagrosh</groupId>
        <artifactId>jda-utilities</artifactId>
        <version>2.1</version>
        <scope>compile</scope>
        <type>pom</type>
    </dependency>
</dependencies>
<repositories>
    <repository>
        <id>jcenter</id>
        <name>jcenter-bintray</name>
        <url>http://jcenter.bintray.com</url>
    </repository>
    <repository>
        <id>central</id>
        <name>bintray</name>
        <url>http://jcenter.bintray.com</url>
    </repository>
</repositories>

为什么要用这么老的版本?

来自 https://github.com/DV8FromTheWorld/JDA and https://mvnrepository.com/artifact/net.dv8tion/JDA/5.0.0-alpha.3

的最新消息
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>5.0.0-alpha.3</version>
</dependency>